![]() The circular planes can be defined as planes cutting across the spheres. So we can use the vertices of the circular planes to form triangles and patches to create this 3D object. ![]() This 3D object can be constructed by using two circular planes and creating a surface to link these together. In the draw functions we add the functions to upload the vertices and color buffer onto the shaders, and then call the GLDrawElements to draw the second sphere. We can then create the buffers for storing the vertices and color indexes of our second sphere. As I want the color of the second sphere to be a green gradient color, I modify the color for the vertices to have a green gradient color. To draw this second sphere we basically copy the same vertices from the first sphere, and then offset the y-axis coordinates with a fixed distance. ![]() So to create the two spheres, we can just make small modification of the same routine by adding another vertex array, and off-setting those spheres location along the y-axis by a fixed distance. This 3D object is basically constructed by linking two spheres with a polygon object. Welcome back, let's now look at how we might connect two spheres to create this irregular shaped 3D object. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |