Irrlicht in 3D CAVE

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Mauin
Posts: 4
Joined: Mon May 13, 2013 1:29 pm

Irrlicht in 3D CAVE

Post by Mauin »

We're currently trying to get Irrlicht to run inside a 4-sided 3D virtual reality CAVE with head tracking. (front, bottom, left and right screens)

We already have a framework up and running to get the user's head (and left/right eye) position.

Biggest problem so far is setting a frustum/projection matrix and calculating/setting a modelview matrix according to the user's head position inside that CAVE because it seems like Irrlicht changes everything back to "standard" again after we try to set it up. This is why we tried not to use Irrlicht's cameras because they recalculate the view matrix on rendering.

Our functions to calculate our projection/modelview matrices can be found here: http://pastebin.com/MgcnFKJR

We're not sure how to set up our "custom" matrices into the Irrlicht engine to get a nice 3D view of the scene. All we're getting so far is weird clipping errors.

Any help you can give us is appreciated!
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Irrlicht in 3D CAVE

Post by hendu »

You'll need to edit the code for that - remove the recalculate call in CCameraSceneNode's render(), add a setViewMatrix function.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht in 3D CAVE

Post by hybrid »

There is already a function which adds a 'view matrix affector' which is multiplied with the view matrix before passing everything to the gfx card. Maybe that's enough. Also you could calculate the position and angles for the head and set up the camera accordingly, instead of directly calculating the matrices.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Irrlicht in 3D CAVE

Post by Nadro »

As Hybrid said ICameraSceneNode::setViewMatrixAffector, should be enough.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Mauin
Posts: 4
Joined: Mon May 13, 2013 1:29 pm

Re: Irrlicht in 3D CAVE

Post by Mauin »

Thanks guys. We finally made it work using the Camera Affector and changing the CameraSceneNode from
*= Affector
to = Affector
where we input our Modelview Matrix.

Looks great now!
Mauin
Posts: 4
Joined: Mon May 13, 2013 1:29 pm

Re: Irrlicht in 3D CAVE

Post by Mauin »

Alright, we've run into another problem...
We've got all screens working together quite nicely, we got the 3D-effect working and we're loading the Quake 3 Map tutorial which works in general, but it seems like all normals of the map are inverted. Basically we're only looking at all the backfaces.
If we scale our whole scene by -1.0 on the z-axis it looks fine but then we're getting problems with stuff like camera positions and octree rendering.

We're suspecting that there is still an issue with the projection matrix which we maybe have to invert, but we're not sure.
Anyone have any ideas on how to fix it?
markmze
Posts: 24
Joined: Fri Apr 19, 2013 1:09 am

Re: Irrlicht in 3D CAVE

Post by markmze »

material.NormalizeNormals = true; ??

If you're using the settings of the quake3map loading your normals shouldn't change, and it's not related to your camera or anything.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht in 3D CAVE

Post by hybrid »

You maybe didn't use the Irrlicht style of projection. Irrlicht uses left-handed coord system, so z increases into the screen. I guess oyu inverted everything. Simply negate the z-coord element, should be M[11] IIRC.
markmze
Posts: 24
Joined: Fri Apr 19, 2013 1:09 am

Re: Irrlicht in 3D CAVE

Post by markmze »

Did anyone manage to do this using VR juggler ? or what VR framework would better?
Post Reply