PDA

View Full Version : Defining Asymmetric Viewing Frustum


chris2307
10-01-2014, 09:41 AM
Second post today... sorry about that!

I'm trying to use viz.window.frustum() to define an asymmetric viewing frustum. Here is what I am trying to achieve:

I have a screen which is 88.5cm in width and 50cm in height. User's of the application will be sitting so their eyes are approximately 80cm from the screen. Their eyes will be positioned 2/3s of the way up the screen.

I've calculated the total vertical field of view to be 34.31 degrees and therefore the horizontal field of view being 60.72. With a symmetric viewing frustum I would simply set this up as:


fieldOfView = 34.7
aspectRatio = 1.77
viz.fov(fieldOfView, aspectRatio)


However, this assumes that the user's eyes are perfectly centered in the screen (vertically) which I do not want. So with the eyes 2/3s of the way up the screen, I would like an asymmetric viewing frustum to better represent this. In other words, with the eyes positioned vertically 2/3s of the way up of the screen, the angle between the eyes and top of the screen is 11.72 degrees and the angle between the eyes and the bottom of the screen being 22.59 degrees. This still gives me the overall vertical FOV of 34.7 but in an asymmetric shape.

I am looking at the viz.window.frustum() function but it's not behaving in the way I want it to. Considering that the viz.window.frustum() function is mentioned to be the same as glFrustum(), I was expecting this function to multiply the current frustum by the values passed in to it (this is where my understanding may well be incorrect).

I've therefore been trying this to start with:


fieldOfView = 34.7
aspectRatio = 1.77
viz.fov(fieldOfView, aspectRatio)
viz.MainWindow.frustum(-1, 1, -1, 1, 1, 10000)


What I thought this would do is, well... nothing. I thought this would multiple the current frustum by the 1 and remain the same. I've tried different values and it always looks distorted. I've been able to get close to something that looks OK but, of course, I need the FOV to be exactly right.

I really hope someone can help me out here.

Jeff
10-01-2014, 11:37 AM
You can use the vizcave (http://docs.worldviz.com/vizard/#Vizcave.htm) module for this type of setup. You could base your configuration script on the powerwall (http://docs.worldviz.com/vizard/#vizcave_powerwall.htm) example. For the head_tracker object you could create a group node with a static position since the user is stationary.