Ogre Render Line list completely wrong

Problems building or running the engine, queries about how to use features etc.
Post Reply
andreahmed
Kobold
Posts: 38
Joined: Wed Dec 31, 2014 2:26 am
x 2

Ogre Render Line list completely wrong

Post by andreahmed »

Hi
I'm trying to render line list using indices of triangles as follow

uint16_t *indices = static_cast<uint16_t *>(indexBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));


int l, t;
int numTriangles = out.numberoftrifaces;
for (l = 0, t = 0; t<numTriangles; t += 3) {
// Each vertex has to be listed twice
indices[l] = out.trifacelist[t]; l++;
indices[l] = out.trifacelist[t + 1]; l++;
indices[l] = out.trifacelist[t + 1]; l++;
indices[l] = out.trifacelist[t + 2]; l++;
indices[l] = out.trifacelist[t + 2]; l++;
indices[l] = out.trifacelist[t]; l++;
}


indexBuffer->unlock();

The problem that ogre renders broken triangles and it's completely wrong. I'm not doing anything wrong regarding rendering the lines that the triangles are composed

I'm using ogre 1.9
andreahmed
Kobold
Posts: 38
Joined: Wed Dec 31, 2014 2:26 am
x 2

Re: Ogre Render Line list completely wrong

Post by andreahmed »

Post Reply