Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 487 Bytes

7. Drawing cube(s).md

File metadata and controls

14 lines (12 loc) · 487 Bytes
  • add vertex data
  • modify vao accodingly
  • bam! cube can be seen
  • PROBLEM : depth is not considered
    • sol :
      • glEnable(GL_DEPTH_TEST);
      • glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

draw more cubes:

  • how?
    • can add more vertices , but we can use one cube specification and draw multiple cubes
    • in draw function, add cube position data and then translate the cube accordingly in world space and draw the cube
    • iterate this process to get multiple cubes :)