NULL Driver. Transformation problem [solved]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mmortall
Posts: 23
Joined: Tue May 11, 2010 6:36 am
Location: Kharkiv
Contact:

NULL Driver. Transformation problem [solved]

Post by mmortall »

I am writing my own render using NULL driver and I got strange issue.

For set up transformation I use code:

Code: Select all

 
m_irrnode->updateAbsolutePosition();
glMultMatrixf(m_irrnode->getAbsoluteTransformation().pointer());
 
After this I find that transformation of all objects become like mirror. Looks like some problem with coordinate system.
But when I use pure Irrlicht with OpenGL Driver and set transformation using setPosition, setRotation etc. all is right.

As I see in the code Irrlicht use the same world matrix for DirectX and OpenGL device, but its have different coordinate systems. How Irrlicht solve this problem?
Last edited by mmortall on Mon Sep 05, 2011 10:53 am, edited 1 time in total.
mmortall
Posts: 23
Joined: Tue May 11, 2010 6:36 am
Location: Kharkiv
Contact:

Re: NULL Driver. Transformation problem [SOLVED]

Post by mmortall »

I fix it.
I convert View matrix to left-hand system and change back face culling direction.
So I change

Code: Select all

 
gluLookAt(pos.X, pos.Y, pos.Z, target.X, target.Y, target.Z, up.X, up.Y, up.Z);
 
glFrontFace(GL_CCW);
 
to

Code: Select all

 
gluLookAt(pos.X, pos.Y, pos.Z, target.X, target.Y, target.Z, up.X, up.Y, up.Z);
glScalef(1.0f, 1.0f, -1.0f);
 
glFrontFace(GL_CW);
 
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: NULL Driver. Transformation problem [solved]

Post by hybrid »

What's the purpose of yet another OpenGL driver?
mmortall
Posts: 23
Joined: Tue May 11, 2010 6:36 am
Location: Kharkiv
Contact:

Re: NULL Driver. Transformation problem [solved]

Post by mmortall »

hybrid wrote:What's the purpose of yet another OpenGL driver?
I write modern and much faster driver. 30 000 triangles in scene is limit of Irrlicht OpenGL driver (render in ~10 ms).
Pure OpenGL with VBO draw over 1 000 000 triangles in 1.5 ms.
Also driver will be shader-based.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: NULL Driver. Transformation problem [solved]

Post by hybrid »

You can easily get a VBO based mesh rendering already now in Irrlicht. And we also have a shader based (opengl-es 2.x) driver in the opengl-es branch. Just to note that not every wheel needs to be re-invented...
Post Reply