I am a beginner of Irrlicht.
I want to draw a piece of surface. For example, there are four corner points, P1,P2,P3,P4
Can I draw a surface according to the four points?
By now, I used driver->drawIndexedTriangleList() to draw 2 triangle plane,
P1-P2-P4 and P1-P4-P3.
But I only can see the surface on the top direction of the surface but can not see it on side direction( I know it is because the surface has not thickness).
Is there any method to make it visible ? (Of course, I can draw a thin block to do this, but it wasted too much)
Thank you for your kindly help.
Can Irrlicht draw a piece of surface?
Re: Can Irrlicht draw a piece of surface?
This is exactly what happens when you use drawIndexedTriangleList(). It draws the surface using the four points, rendering it as two triangles.mybiandou wrote:I want to draw a piece of surface. For example, there are four corner points, P1,P2,P3,P4
Can I draw a surface according to the four points?
Yes. A plane has no thickness.mybiandou wrote: By now, I used driver->drawIndexedTriangleList() to draw 2 triangle plane,
P1-P2-P4 and P1-P4-P3.
But I only can see the surface on the top direction of the surface but can not see it on side direction( I know it is because the surface has not thickness).
If you want to be able to see the object as a rectangular hexahedron, you have no choice but to give it thickness. If you just want to be able to see the surface from both sides, but don't need it to have thickness, you could just disable backface culling when rendering the verticies, or you could render the triangles again in the order P1-P4-P2 and P1-P3-P4.mybiandou wrote:Is there any method to make it visible ? (Of course, I can draw a thin block to do this, but it wasted too much)
BTW, I have no idea what you mean when you say it wasted too much.
Travis
Re: Can Irrlicht draw a piece of surface?
Thank you for your kindly answer.
It seems that I have to draw the sheet on the top surface and bottom surface and the two side thickness surface.
It seems that I have to draw the sheet on the top surface and bottom surface and the two side thickness surface.
Maybe he wants to see both sides of his plane?
Disable backface and frontface culling in your material, eg
Disable backface and frontface culling in your material, eg
Code: Select all
video::SMaterial m;
m.BackfaceCulling=false;
driver->setMaterial(m);
driver->drawIndexedTriangleList