setTransform not working

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
andytheb
Posts: 6
Joined: Fri Apr 04, 2008 3:41 pm

setTransform not working

Post by andytheb »

Hi,

I'm trying to get setTransform to work for headtracking. But while the generated projection matrix changes a desired, there is no change in the graphical output.

Code: Select all

    float nearPlane = 0.05;
    matrix4 projectionMatrix = make_projection_matrix( nearPlane*( -0.5 * aspectRatio + headPosition.X)/ d,
						       nearPlane*(  0.5 * aspectRatio + headPosition.X)/ d,
						       nearPlane*( -0.5 - headPosition.Y ) / d,
						       nearPlane*(  0.5 - headPosition.Y ) / d,
						       nearPlane, 100);
    
    driver->setTransform(ETS_PROJECTION, projectionMatrix);
    
    smgr->drawAll();
       
    driver->endScene();
Is there anything I've missed?

I'm using opengl on linux x64.

Andy
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The camera will, as part of smgr->drawAll(), reset the projection matrix. Even if you aren't using a camera, then the scene manager still resets the projection to the identity matrix. If you want to set the projection matrix, you should set the projection on the camera directly.

Out of curiousity, what device are you using for head tracking?

Travis
andytheb
Posts: 6
Joined: Fri Apr 04, 2008 3:41 pm

Post by andytheb »

Ah, ok, the projection is being applied now.

I'm using a webcam (with sunglasses as filter) that tracks two bright red leds that are attached to some glasses.
This works ok, at least in a dark room.
You don't really need irleds, because the cmos sensor is sensitive enough in that part of the spectrum.

I'll release the source, as soon as I get the projection right...

Andy
andytheb
Posts: 6
Joined: Fri Apr 04, 2008 3:41 pm

Post by andytheb »

Post Reply