How to draw a custom shape

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
alaNegru
Posts: 5
Joined: Sun Mar 16, 2008 12:16 pm

How to draw a custom shape

Post by alaNegru »

Hi, i am working at a 2d project and i want to use irrlicht only for rendering. (colission, geometry stuff will be independent)

My problem is how to draw a triangle and fill it with colour (or even better a texture).

I think i have to create custom scene node but i am not sure how.
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

Look at the tutorials in the sdk :)
alaNegru
Posts: 5
Joined: Sun Mar 16, 2008 12:16 pm

Post by alaNegru »

i did that already. It doesn't say how to draw an arbitrary shape (decided at runtime). I want to give it the points in order and fill it with colour.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You don't need a custom node, just create your polys in a meshbuffer, put them into a mesh, and add that to a mesh scene node. This will work for both 2d and 3d scenes and allows for exact control and easy manipulation of the vertices. Arbitrary 2d geometry is not supported, but you won't notice any performance differences.
Post Reply