Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function render() {
- gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
- gl.uniformMatrix4fv(mProjecLoc, false, flatten(mProjection));
- gl.uniformMatrix4fv(modelViewLoc, false, flatten(mView));
- gl.uniformMatrix4fv(normalsLoc, false, flatten(mNormals));
- if(wire){
- if(shape==0){
- cubeDrawWireFrame(gl,program);
- }
- else if(shape==1){
- pyramidDrawWireFrame(gl, program);
- }
- else if(shape==2){
- sphereDrawWireFrame(gl, program);
- }
- else if(shape==3){
- torusDrawWireFrame(gl, program);
- }
- else if(shape==4){
- cylinderDrawWireFrame(gl,program);
- }
- else if(shape==5){
- //cone
- }
- }
- else{
- if(shape==0){
- cubeDrawFilled(gl, program);
- }
- else if(shape==1){
- pyramidDrawFilled(gl, program);
- }
- else if(shape==2){
- sphereDrawFilled(gl, program);
- }
- else if(shape==3){
- torusDrawFilled(gl, program);
- }
- else if(shape==4){
- cylinderDrawFilled(gl, program);
- }
- else if(shape==5){
- //cone
- }
- }
- window.requestAnimationFrame(render);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement