Hey guys, just looking for some guidance here. In short I'm doing like a terrain editor. I want a plane and I want to be able to manipulate the vertices in it. I don't wish for anyone to do it for me, just some direction.
The different mesh types have confused me thus far. So:
1. What is it that I need to create to act as, maybe a 10x10 grid of vertices just to play with?
2. How do I access these vertices, the actual values I mean?
3. Is each vertex simply vector3df coords? And therefore easily editable once I find these functions I'm looking for?
To sum up. What do I use to create a flat plane, then how can I change one vertex in it to move it up and down. I'll figure out the rest on my own. Thanks!
PS If I can get this worked out I'll add what I learn to the wiki to hopefully help future people looking at this.
How to edit mesh vertices?
-
- Posts: 11
- Joined: Mon Mar 14, 2011 10:48 am
I've looked at and extracted a lot of things from these two tutorials, the thing that I either can't figure out or is missing is the editing of a vertex during runtime. What function is it?
EDIT: Ok so to elaborate a little more. This is the impression that I'm under:
I need a mesh and a meshbuffer. The meshbuffer holds the vertices.(?) I have the code from the tutorials, but all those load from a heightmap, making it hard for me to decipher what is ACTUALLY going on here. I want to, for learning's sake, just make it simple and plug my own small numbers in there. Then I get a little lost...The meshbuffer goes on to to mesh.init to give it the vertices? or what happens?
I've been going over these tut's for a week now and still don't get the underlying concepts of what actually happens here. All the examples using a heightmap is throwing me off.
EDIT: Ok so to elaborate a little more. This is the impression that I'm under:
I need a mesh and a meshbuffer. The meshbuffer holds the vertices.(?) I have the code from the tutorials, but all those load from a heightmap, making it hard for me to decipher what is ACTUALLY going on here. I want to, for learning's sake, just make it simple and plug my own small numbers in there. Then I get a little lost...The meshbuffer goes on to to mesh.init to give it the vertices? or what happens?
I've been going over these tut's for a week now and still don't get the underlying concepts of what actually happens here. All the examples using a heightmap is throwing me off.
Last edited by jfisher446 on Mon Mar 21, 2011 8:38 pm, edited 1 time in total.
-
- Posts: 11
- Joined: Mon Mar 14, 2011 10:48 am
Ok reading over that, sounds like he was almost in the same predicament as I am. The difference though is that I wish not to use a heightmap. I was editing the post above when you posted your last response, but now, how does one go about skipping the heightmap portion to great the geometry of the mesh, and instead to it manually?
-
- Posts: 11
- Joined: Mon Mar 14, 2011 10:48 am
-
- Posts: 363
- Joined: Thu Dec 16, 2010 8:50 pm
- Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..
make sure you dont forget to call the meshbuffers setDirty() method so the driver knows you update vertex data
ent1ty wrote: success is a matter of concentration and desire
at a cost measure in computer resourcesButler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
-
- Posts: 11
- Joined: Mon Mar 14, 2011 10:48 am