Editing mesh in real time

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
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Editing mesh in real time

Post by rubenwardy »

How can I edit meshes in real time? For example, I would like to create a house using vectors as walls. (as opposed to bitmaps).

Code: Select all

line_vector{ from, to }
and if I have a vector collection like this:

Code: Select all

 ----
|    |
|    |
 ----
It needs to create a box with an inside, and 0.3m thick walls.

I suppose I need to edit vertices, right? What about texturing?

What I am looking for is a point in the right direction, with a suggestion on how to do this effectively.
I would also like to create corridors with a single line vector, but that is not too different from this.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Editing mesh in real time

Post by CuteAlien »

Check example 23. It's unfortunately a little complicated and doing more stuff. But basically you create an SMesh and then you can add meshbuffers to it (SMeshBuffer). You have one MeshBuffer per Material which you need. And in the MeshBuffer you set directly the vertices and indices for your wall. The vertex structure als has uv-coordinates for texturing.

I don't know how familiar you are with stuff like meshbuffers, the way indexes arrays are used and with uv-coordinates etc - so if you have questions about that just ask again.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
rubenwardy
Posts: 91
Joined: Mon Mar 05, 2012 4:51 pm
Location: Bristol, UK
Contact:

Re: Editing mesh in real time

Post by rubenwardy »

Looking at the strip, I assume that it is a triangle strip?
What is y0 and y1 in the strip function? Is it a from/to height, or depth?
Post Reply