set vertex position

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
byllgrim
Posts: 9
Joined: Mon May 28, 2012 12:13 pm

set vertex position

Post by byllgrim »

how can i get a vertex from a mesh and change its position?

sorry if this was too easy and should be on the newb help board
chronologicaldot
Competition winner
Posts: 685
Joined: Mon Sep 10, 2012 8:51 am

Re: set vertex position

Post by chronologicaldot »

Suppose you have a mesh called "m".

Code: Select all

 
void* vertices = m->getMeshBuffer(0)->getVertices();
 
I put vertices as "void* " to tell you what the function itself returns. In actuality, void* should be replaced by whatever vertex type is used in the mesh. I believe this is irr::video::S3DVertex by default.
byllgrim
Posts: 9
Joined: Mon May 28, 2012 12:13 pm

Re: set vertex position

Post by byllgrim »

i was set off by the fact that it returned void, and therefore didnt understand that it should be placed in a S3DVertex. Thanks, i will try what you said

edit:
thanks a lot!
http://puu.sh/4vwGX.PNG
Post Reply