提交 754e2812 编写于 作者: M Mr.doob

Improved interactive lines example.

上级 035adee5
......@@ -49,8 +49,22 @@
scene = new THREE.Scene();
var sphereGeometry = new THREE.SphereGeometry(3);
sphereInter = new THREE.Mesh( sphereGeometry, new THREE.MeshBasicMaterial( { color: 0xff0000 } ) );
var PI2 = Math.PI * 2;
var program = function ( context ) {
context.beginPath();
context.arc( 0, 0, 1, 0, PI2, true );
context.fill();
}
sphereInter = new THREE.Particle(
new THREE.ParticleCanvasMaterial( {
color: 0xff0000,
program: program }
)
);
sphereInter.scale.x = sphereInter.scale.y = 2;
sphereInter.visible = false;
scene.add( sphereInter );
......@@ -59,7 +73,7 @@
var point = new THREE.Vector3();
var direction = new THREE.Vector3();
for ( var i = 0; i < 200; i ++ ) {
for ( var i = 0; i < 100; i ++ ) {
direction.x += Math.random() - 0.5;
direction.y += Math.random() - 0.5;
......@@ -194,6 +208,14 @@
} else {
if ( currentIntersected !== undefined ) {
currentIntersected.material.linewidth = 1;
}
currentIntersected = undefined;
sphereInter.visible = false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册