A lot of demos of three.js
https://github.com/stemkoski/stemkoski.github.com/tree/master/Three.js
Make rain
Note: Due to the version issues, this line :particle = new THREE.Vertex(new THREE.Vector3(pX, pY, pZ)); Change to particle = new THREE.Vector3(pX, pY, pZ);
For this line, I directly add particle velocity to particle position.addSelf()does not work in my project.
particle.position.addSelf(
particle.velocity);
}
http://danni-three.blogspot.com/2013/09/threejs-particle-engine.html?showComment=1456265994236#c986744027506486296Note: I have tried to apply this but failed, did not figure out the problem. But it is a useful resource.
Sky box
Note: The thing that useful to my project is in the comments:skyboxMesh.doubleSided = true;
Sky texture
Add audio
Free 3D models
https://www.cgtrader.com/3d-models?keywords=abandoned
Load models to three js
Note: I use ColladaLoader.js to load the .dae model which is more convenient. Because the ColladaLoader.js is from the original game project itself, it can avoid incompatible problems caused by versions. My three.js and JSONloader.js that I downloaded from other place version(not latest) do not match the model.json format version. It threw old format(It's actually too new, it's the latest).
https://quaintproject.wordpress.com/2014/01/25/exporting-from-blender-to-web-gl-using-collada-and-three-js-part-2/
Note: Use blender to export .dae. Pay attention to the settings in this link.
problems and solutions
http://webroxtar.com/2011/10/solution-jquery-click-event-gets-called-twice-fires-twice/Note: Click once, run once. My problem is I put the click function inside the animation loop, when I click once, the lines inside it will keep on looping. This is also the reason why sometimes the toggle button does not work, click ones means keep on clicking thousand of times.
http://stackoverflow.com/questions/8733179/what-is-the-equivalent-of-javas-system-out-println-in-javascript
Note: Use to debug.
https://github.com/mrdoob/three.js/issues/1586
Note: Change texture in render loop:
sphere.material.map = THREE.ImageUtils.loadTexture('texture0.png',{},function(){ //add callback here if you want });