CC3ParametricMeshes mesh = new CC3ParametricMeshes(0, "myShape");
and then we specify the appropriate populate method for the particular shaper we're after that will load the corresponding locations, normals and tex coordinates. So, we could create a sphere by
// radius and tessellation mesh.PopulateAsSphere(3.0f, new CC3Tessellation(50,50));
or a cone by calling
// base radius, height and tessellation mesh.PopulateAsHollowCone(3.0f, 5.0f, new CC3Tessellation(50, 50));
and so on. Currently, within Cocos3D-XNA the CC3ParametricMeshes class additionally provides support for creating rectangles and planes.
Once we've populated our mesh, that's pretty much it with respect to our drawing data! It's just a matter of associating our mesh with a corresponding material and putting it altogether as seen below
Click to enlarge |
No comments:
Post a Comment