Time for action — using more triangles for volume
We will use the previous code and we will only add two new quads to our grass blades:
- After the first two triangles, add the third and fourth triangle for the second quad:
//third triangle manual->position(2.5, 0.0, 4.3); manual->textureCoord(1,1); manual->position(-2.5, 10.0, -4.3); manual->textureCoord(0,0); manual->position(-2.0, 0.0, -4.3); manual->textureCoord(0,1); //fourth triangle manual->position(2.5, 0.0, 4.3); manual->textureCoord(1,1); manual->position(2.5, 10.0, 4.3); manual->textureCoord(1,0); manual->position(-2.5, 10.0, -4.3); manual->textureCoord(0,0);
- Add the fifth and sixth triangle for the third quad:
//fifth triangle manual->position(2.5, 0.0, -4.3); manual->textureCoord(1,1); ...
Get Ogre 3D 1.7 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.