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!
Irrlicht in 3D CAVE
Re: Irrlicht in 3D CAVE
You'll need to edit the code for that - remove the recalculate call in CCameraSceneNode's render(), add a setViewMatrix function.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Irrlicht in 3D CAVE
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.
Re: Irrlicht in 3D CAVE
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
Re: Irrlicht in 3D CAVE
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!
*= Affector
to = Affector
where we input our Modelview Matrix.
Looks great now!
Re: Irrlicht in 3D CAVE
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?
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?
Re: Irrlicht in 3D CAVE
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.
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.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Irrlicht in 3D CAVE
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.
Re: Irrlicht in 3D CAVE
Did anyone manage to do this using VR juggler ? or what VR framework would better?