how to detect order of vertices?
how to detect order of vertices?
Hi @ll,
as explained i have created an array of simple planes. Now i want to adress single vertices and modify them. I noticed that the vertices of my meshes were sorted in different ways. V[0] of one mesh was not at the same position as V[0] of another one, although the mesh was based on same geometry.
I hope a picture can show my problem:
So how can i detect the specific order of vertices? How to know which one will be adressed with a specific number (v[x])?
Greetings,
Krampe³
as explained i have created an array of simple planes. Now i want to adress single vertices and modify them. I noticed that the vertices of my meshes were sorted in different ways. V[0] of one mesh was not at the same position as V[0] of another one, although the mesh was based on same geometry.
I hope a picture can show my problem:
So how can i detect the specific order of vertices? How to know which one will be adressed with a specific number (v[x])?
Greetings,
Krampe³
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
Hum... i used the meshmanipulator o.O You dont believe i was able to do it without you guys, do you?^^if you would try my suggestion and use the meshmanipulator-copy then all meshes are equal and all 0,1,2,3 have the same position.
Code: Select all
tempmesh = smgr->getMesh("tile.3ds");
tileset[i][j]=smgr->getMeshManipulator()->createMeshCopy(tempmesh->getMesh(0));
Thats the question... i even read that vertices are always following each other (clockwise or counter-clockwise)... but thats not happening in my app... i've got every possible combination there could be o.OHow have you got different positions of the points ?
Just a quick mesh i tinkered for some minutes with, some kind of troll, dont feed him^^And who is the freak standing left in the pic ?
-
- Posts: 108
- Joined: Fri Aug 22, 2003 1:04 pm
- Location: Kerkrade, Netherlands
- Contact:
That Troll is just as ugly as the picture in the Dungeons and Dragons Monster ManualKrampe wrote:Just a quick mesh i tinkered for some minutes with, some kind of troll, dont feed him^^
and another question, where did u got taht nice ground mesh? i mean like with that texture, when i add a texture its all spread wide, and when i make my own, my comp runs out of memory
I've been absent for really long, but i'm ready to reign my terror on you once again, mwuahahahahaha
That Troll is just as ugly as the picture in the Dungeons and Dragons Monster Manual
Hehe, i created this from my memory, but indeed a troll out of an old monster manual was in my head
and another question, where did u got taht nice ground mesh? i mean like with that texture, when i add a texture its all spread wide, and when i make my own, my comp runs out of memory
I dont know if i understand this correctly... i used just a simple plane mesh and made a seamless texture for it. The texture is 256x256 pixels. What you see are 20x20 tiles with that single texture, not a single mesh.
Hehe, i created this from my memory, but indeed a troll out of an old monster manual was in my head
and another question, where did u got taht nice ground mesh? i mean like with that texture, when i add a texture its all spread wide, and when i make my own, my comp runs out of memory
I dont know if i understand this correctly... i used just a simple plane mesh and made a seamless texture for it. The texture is 256x256 pixels. What you see are 20x20 tiles with that single texture, not a single mesh.
-
- Posts: 108
- Joined: Fri Aug 22, 2003 1:04 pm
- Location: Kerkrade, Netherlands
- Contact:
-
- Posts: 108
- Joined: Fri Aug 22, 2003 1:04 pm
- Location: Kerkrade, Netherlands
- Contact:
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
> ...*waits for KnightofLight and hopes he is able to help Krampe³*
sorry, i'm also a beginner, the truth is: cause Nikos Irrlicht is NEW, were all beginners (instead of Niko whos the Irrlicht-god).
If you really copied the meshes, the vertices CANT be different (a copy is a copy)
-> (my opinion) logical consequence is that theres a bug in you prog/access to the vertices
-> (my opinion) logical consequence is that you have to search the bug
sorry, i'm also a beginner, the truth is: cause Nikos Irrlicht is NEW, were all beginners (instead of Niko whos the Irrlicht-god).
If you really copied the meshes, the vertices CANT be different (a copy is a copy)
-> (my opinion) logical consequence is that theres a bug in you prog/access to the vertices
-> (my opinion) logical consequence is that you have to search the bug
We are all new to Irrlicht, but im new to 3d concepts and c++ also For example, you are much more skilled than old, litte Krampe
If you really copied the meshes, the vertices CANT be different (a copy is a copy)
-> (my opinion) logical consequence is that theres a bug in you prog/access to the vertices
-> (my opinion) logical consequence is that you have to search the bug
Yep sounds good. But i dont know how to find this bug... I used the meshmanipulator and copied the tile.3ds many times. I can adress every single tile and change its properties - so the copy process was ok.
I know i made a mistake somehow...
This is an extract of my code, perhaps you can have a look?
If you really copied the meshes, the vertices CANT be different (a copy is a copy)
-> (my opinion) logical consequence is that theres a bug in you prog/access to the vertices
-> (my opinion) logical consequence is that you have to search the bug
Yep sounds good. But i dont know how to find this bug... I used the meshmanipulator and copied the tile.3ds many times. I can adress every single tile and change its properties - so the copy process was ok.
I know i made a mistake somehow...
This is an extract of my code, perhaps you can have a look?
Code: Select all
scene::IAnimatedMesh* tempmesh;
scene::ISceneNode* combatMap[cTileBreite][cTileBreite];
scene::IMesh* tileset[cTileBreite][cTileBreite];
for (irr::s32 i = 0; i<cTileBreite; i++)
{
for (irr::s32 j = 0; j<cTileBreite; j++)
{
//Tileset laden
tempmesh = smgr->getMesh("tile.3ds");
tileset[i][j]=smgr->getMeshManipulator()->createMeshCopy(tempmesh->getMesh(0));
//this is from saigumis seamless world:
irr::s32 LBName = (i*256) - j;
combatMap[i][j] = smgr->addMeshSceneNode(tileset[i][j]);
combatMap[i][j]->setPosition(irr::core::vector3df(32.0f*(i-9),0.0f,32.0f*(j-9)));
combatMap[i][j]->setMaterialFlag(irr::video::EMF_LIGHTING, false);
combatMap[i][j]->setMaterialTexture( 0, driver->getTexture("gras.jpg") );
}
}
//**************** Vertices manipulieren
scene::IMeshBuffer* buffer = tileset[10][10]->getMeshBuffer(0);
video::S3DVertex* v = (video::S3DVertex*)buffer->getVertices();
v[3].Pos.Y=30;
v[2].Pos.Y=30;
buffer = tileset[10][12]->getMeshBuffer(0);
v = (video::S3DVertex*)buffer->getVertices();
v[2].Pos.Y=30;
v[3].Pos.Y=30;
buffer = tileset[10][11]->getMeshBuffer(0);
v = (video::S3DVertex*)buffer->getVertices();
v[3].Pos.Y=30;
v[2].Pos.Y=30;
v[1].Pos.Y=30;
v[4].Pos.Y=30;
v[5].Pos.Y=30;
v[0].Pos.Y=30;
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany