Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. function render() {
  2. gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
  3.  
  4. gl.uniformMatrix4fv(mProjecLoc, false, flatten(mProjection));
  5. gl.uniformMatrix4fv(modelViewLoc, false, flatten(mView));
  6. gl.uniformMatrix4fv(normalsLoc, false, flatten(mNormals));
  7.  
  8. if(wire){
  9. if(shape==0){
  10. cubeDrawWireFrame(gl,program);
  11. }
  12. else if(shape==1){
  13. pyramidDrawWireFrame(gl, program);
  14. }
  15. else if(shape==2){
  16. sphereDrawWireFrame(gl, program);
  17. }
  18. else if(shape==3){
  19. torusDrawWireFrame(gl, program);
  20. }
  21. else if(shape==4){
  22. cylinderDrawWireFrame(gl,program);
  23. }
  24. else if(shape==5){
  25. //cone
  26. }
  27. }
  28. else{
  29. if(shape==0){
  30. cubeDrawFilled(gl, program);
  31. }
  32. else if(shape==1){
  33. pyramidDrawFilled(gl, program);
  34. }
  35. else if(shape==2){
  36. sphereDrawFilled(gl, program);
  37. }
  38. else if(shape==3){
  39. torusDrawFilled(gl, program);
  40. }
  41. else if(shape==4){
  42. cylinderDrawFilled(gl, program);
  43. }
  44. else if(shape==5){
  45. //cone
  46. }
  47. }
  48. window.requestAnimationFrame(render);
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement