Game Development Community

Derived from GameBase & Dts & transform

by Jendrik Posche · in Torque Game Engine · 05/15/2008 (8:38 am) · 0 replies

Hi All,

Im playing around with a custom derived object and inside the render() method I want to draw a wireframe overlay. I grab each triangle from the tsmesh and drawprimitive and iterate over it. Since these are not transformed yet, I do a matrix multiply with the getTransform() on them.

However my overlay seems not to have the correct orientation. This is the situation:
I have a 6 sided box where;

Top = Magenta
Bottom = Cyan
Front = Red
Back = Green
Left = Blue
Right = Yellow

I mapped the material id's to render out the same color (somehow the max2dts exporter messes up the assigned material id's \o/ Maybe someone can enlighten me on this)

When I render it. I get the following:
Top = Magenta
Bottom = Cyan
Front = Green
Back = Red
Left = Yellow
Right = Blue

I use the getTransform() in order to move the vertices ( mesh->verts[n] ) to their proper world space.
When I look into other render code, they also use the getTransform or the mObjToWorld matrix. And they all render the same as when previewing in the showtool program.

The getRenderTransform() yields the same issue.

Any ideas on why I get a 180 degrees rotated render with getTransform() or getRenderTransform? Am I missing something?

Regards