Project 3 Three js Project Overview In this project you will create a unique 3D
ID: 3873800 • Letter: P
Question
Project 3
Three js Project Overview
In this project you will create a unique 3D animated scene composed of Three.js graphic components. The scene should include animation, lighting and multiple objects.
Requirements:
1. Using Three.js create a unique 3D animated scene. The scene has the following specifications:
a. Size: minimum of 640x480
b. Includes at least 6 different shapes
c. Uses multiple lighting effects
d. Includes radio buttons, slider bars or other widgets to turn on or off certain components of the animation.
2. Use Three.js
3. All JavaScript source code should be written using Google JavaScript style guide.( http://google.github.io/styleguide/jsguide.html) 4. Prepare, conduct and document a test plan verifying your application is working as expected. This plan should include a test matrix listing each method you tested, how you tested it, and the results of testing
Explanation / Answer
THREE.CircleGeometry = function ( radi, segment, thetaBegin, thetaL) {
THREE.Geometry.cal( );
radi = radi|| 50;
thetaBegin= thetaBegin !== undefined ? thetaBegin : 0;
thetaL= thetaL !== undefined ? thetaL: Math.PI * 2;
segment = segment!== undefined ? Math.max( 4, segment) : 8;
var j, uvi = [],
centr = new THREE.Vectorone(), centrU = new THREE.Vectortwo( 0.5, 0.5 );
this.vertice.push(centr);
uvi.push( centrU );
for ( j = 0; j <= segments; j ++ )
{
var vertices = new THREE.Vectorthree();
var segment = thetaBegin+ i / segment * thetaL;
vertices.k = radius * Math.cos( segments );
vertices.l = radius * Math.sin( segments );
this.vertices.push( vertices );
uvi.push( new THREE.Vectortwo( ( vertices.k / radi + 1 ) / 2, ( vertices.l / radius + 1 ) / 2 ) );
}
var g = new THREE.Vectorthree( 0, 0, 1 );
for ( j= 1; i <= segment; j ++ ) {
var x1 = j;
var x2 = j + 1 ;
var x3 = 0;
this.face.push( new THREE.Facethree( x1, x2, x3, [ g, g, g ] ) );
this.faceVertexUvi[ 0 ].push( [ uvi[ i ], uvi[ i + 1 ], centrU] );
}
this.computeCentroid();
this.computeFaceNormal();
this.boundSphere = new THREE.Sph( new THREE.Vectorthree(), radi);
};
THREE.CircleGeomety.proto = Object.create( THREE.Geomety.proto );
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.