In ogre, we usually import Point Mesh files to construct objects. However, in many cases, we may need to create a very simple plane or line, or sometimes you want to create such an object in a program, you need to use the manual object of ogre, just as you use OpenGL to draw an object in a program, define the information you draw in the program, but it is similar to drawing an object in OpenGL.
The method for creating a person to create an object is usually as follows:
1. Use the scenario manager to create a pointer for a person to create an object.
Manualobject * mo = smgr-> createmanualobject ("Mo ");
2. Then use the begin/end of the man-made object to draw, which is similar to that in OpenGL, but the rules are somewhat different:
Mo-> begin ("basewhitenolighting", renderoperation: ot_triangle_list); first, specify the elements and materials to be drawn.
Then the following figure shows the vertex information,
Use Mo-> position to specify the position of a vertex, and then specify the color and direction of the vertex before the sentence and the next Mo-> position, this is totally different from OpenGL.
For example
Mo-> position (-100,100, 0)
Mo-> color (0, 0, 1 );
Mo-> position (100,100, 0 );
The color of the first vertex is blue, not the second vertex!
If no color information is specified, the color of the store is the color of the last vertex with the specified color.
You can write multiple begin end pairs in another manulobject.
After manualobject is created, to render it in the scene, you only need to use scenenode: attach to a scene node.
Or sometimes you need to convert this manualobject to a mesh and call the converttomesh function of manualobject.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/leonwei/archive/2010/08/09/5799748.aspx