WorldViz User Forum Defining Asymmetric Viewing Frustum
 Register FAQ Search Today's Posts Mark Forums Read

#1
10-01-2014, 10:41 AM
 chris2307 Member Join Date: Nov 2013 Posts: 36
Defining Asymmetric Viewing Frustum

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:

Code:
```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).

Code:
```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.
#2
10-01-2014, 12:37 PM
 Jeff WorldViz Team Member Join Date: Aug 2008 Posts: 2,462
You can use the vizcave module for this type of setup. You could base your configuration script on the powerwall example. For the head_tracker object you could create a group node with a static position since the user is stationary.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development