using the follow code i was expecting to obtain meshes in shape of a square instead i obtain a rectangle...
it sound queer as i used triangles with same base and hight.
Code: Select all
// Mesh Node
SMeshBuffer * mb = new SMeshBuffer();
mb->Vertices.push_back(video::S3DVertex(0,0,0, 0.0f,0.0f,0.0f, video::SColor(255,200,60,90), 0.0f, 0.0f));
mb->Vertices.push_back(video::S3DVertex(0,10,0, 0.0f,0.0f,0.0f, video::SColor(255,200,160,190), 0.0f, 0.0f));
mb->Vertices.push_back(video::S3DVertex(10,0,0, 0.0f,0.0f,0.0f, video::SColor(255,200,160,90), 0.0f, 0.0f));
mb->Vertices.push_back(video::S3DVertex(10,10,0, 0.0f,0.0f,0.0f, video::SColor(255,0,60,190), 0.0f, 0.0f));
mb->Indices.push_back( 0);
mb->Indices.push_back( 3);
mb->Indices.push_back(2);
mb->Indices.push_back( 0);
mb->Indices.push_back(1);
mb->Indices.push_back(3);
SMesh *Solid = new SMesh();
Solid->addMeshBuffer(mb);
Solid->recalculateBoundingBox();
IMeshSceneNode * SolidNode = smgr->addMeshSceneNode(Solid);
SolidNode->setMaterialFlag(EMF_LIGHTING, false);
SolidNode->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
// Mesh Node
the camera i have used is
Code: Select all
// Camera
f32 CamPosX = 0.0f,CamPosY = 0.0f,CamPosZ =-100.0f;
cam = smgr->addCameraSceneNode();
cam->setPosition(core::vector3df(CamPosX ,CamPosY ,CamPosZ));
cam->setTarget(core::vector3df( 0,0,0));
suposing the the square will have the vertex like:
0) : 0,0,0
1) : 0,10,0
2) : 10,0,0
3) : 10,10,0
with triangles indexed like this:
0,3,2
0,1,3
do i am mistaking?
could it be an effect of the camera?
Thanks
Cheers