mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 04:56:01 +10:00
* Added point lights example
This commit is contained in:
@@ -15,6 +15,7 @@ Other similar projects: [pre3d](http://deanm.github.com/pre3d/), [pvjs](http://c
|
||||
|
||||
### Examples ###
|
||||
|
||||
[](http://mrdoob.github.com/three.js/examples/lights_pointligts.html)
|
||||
[](http://mrdoob.github.com/three.js/examples/geometry_birds.html)
|
||||
[](http://mrdoob.github.com/three.js/examples/geometry_earth.html)
|
||||
[](http://mrdoob.github.com/three.js/examples/geometry_terrain.html)
|
||||
|
||||
@@ -99,24 +99,24 @@
|
||||
|
||||
object.rotation.y -= 0.01;
|
||||
|
||||
particle1.position.x = Math.sin( time * 0.5 ) * 30;
|
||||
particle1.position.y = Math.cos( time ) * 40;
|
||||
particle1.position.z = Math.cos( time ) * 30;
|
||||
particle1.position.x = Math.sin( time * 0.7 ) * 30;
|
||||
particle1.position.y = Math.cos( time * 0.5 ) * 40;
|
||||
particle1.position.z = Math.cos( time * 0.3 ) * 30;
|
||||
|
||||
light1.position.x = particle1.position.x;
|
||||
light1.position.y = particle1.position.y;
|
||||
light1.position.z = particle1.position.z;
|
||||
|
||||
particle2.position.x = Math.cos( time ) * 30;
|
||||
particle2.position.x = Math.cos( time * 0.3 ) * 30;
|
||||
particle2.position.y = Math.sin( time * 0.5 ) * 40;
|
||||
particle2.position.z = Math.sin( time ) * 30;
|
||||
particle2.position.z = Math.sin( time * 0.7 ) * 30;
|
||||
|
||||
light2.position.x = particle2.position.x;
|
||||
light2.position.y = particle2.position.y;
|
||||
light2.position.z = particle2.position.z;
|
||||
|
||||
particle3.position.x = Math.sin( time ) * 30;
|
||||
particle3.position.y = Math.cos( time ) * 40;
|
||||
particle3.position.x = Math.sin( time * 0.7 ) * 30;
|
||||
particle3.position.y = Math.cos( time * 0.3 ) * 40;
|
||||
particle3.position.z = Math.sin( time * 0.5 ) * 30;
|
||||
|
||||
light3.position.x = particle3.position.x;
|
||||
|
||||
Reference in New Issue
Block a user