WorldViz User Forum Projection Matrix (onto oblique near plane)
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 Thread Tools Rate Thread Display Modes
#1
07-13-2012, 06:01 AM
 andrewjworz Member Join Date: Apr 2011 Posts: 11
Projection Matrix (onto oblique near plane)

I would like to define a projection matrix matrix with an oblique near plane. I have a paper which explains how to do this, but it seems that the projection matrix in Vizard isn't defined in the same way as with OpenGl. Can someone explain why they aren't defined in the same way?

Here is a website which explains how to derive the (regular) projection matrix:
http://www.songho.ca/opengl/gl_projectionmatrix.html
The openGL matrix has the following form:

OpenglProjectionMatrix =
[ [ 2n/(r-l), 0 , (r+l)/(r-l) , 0 ] ,
[ 0 , 2n/(t-b), (t+b)/(t-b) , 0 ] ,
[ 0 , 0 , P33 , P34 ] ,
[ 0 , 0 , -1 , 0 ] ]

Using the 'viz.MainWindow.getProjectionMatrix()' command ( and after varying the near and far parameters), one can see that vizard returns a projection matrix of the form:

VizardProjectionMatrix =
[ [ 2n/(r-l), 0 , (r+l)/(r-l) , 0 ] ,
[ 0 , 2n/(t-b), (t+b)/(t-b) , 0 ] ,
[ 0 , 0 , P33 , -1 ] ,
[ 0 , 0 , P43 , 0 ] ]

If eye space is projected onto a non-oblique near plane, it is easy to resolve this issue by simply switching the two elements ( P34 with P43 ) which are out of place . But in order to define a projection matrix with an oblique near plan, I need to define two more elements in the openGL-style matrix ( P31 and P32). My quick fix can't work anymore, so I'm wondering (1) is there anyway I can set the projection matrix as defined by openGL? (2) Is there any special reason the projection matrix is defined differently in Vizard?

Here is the form of the matrix which I need to define:

ObliqueProjectionMatrix =
[ [ 2n/(r-l), 0 , (r+l)/(r-l) , 0 ] ,
[ 0 , 2n/(t-b), (t+b)/(t-b) , 0 ] ,
[ P31 , P32 , P33 , P34 ] ,
[ 0 , 0 , -1 , 0 ] ]

Any help would be appreciated.thanks!
-Andy
#2
07-13-2012, 09:10 AM
 farshizzo WorldViz Team Member Join Date: Mar 2003 Posts: 2,849
Have you tried using the viz.MainWindow.setProjectionMatrix() command?

Code:
```ObliqueProjectionMatrix = [
2n/(r-l), 0 , (r+l)/(r-l) , 0,
0 , 2n/(t-b), (t+b)/(t-b) , 0,
P31 , P32 , P33 , P34,
0 , 0 , -1 , 0
]

viz.MainWindow.setProjectionMatrix(ObliqueProjectionMatrix)```
Just make sure the projection matrix is a 16 item 1-dimensional array.

 Tags oblique near plane, projection matrix

 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

 Similar Threads Thread Thread Starter Forum Replies Last Post michaelrepucci Vizard 5 12-14-2011 10:29 AM kwkim Vizard 0 08-31-2011 12:53 AM FreakyT Vizard 2 04-27-2011 05:34 PM k_iwan Vizard 3 03-13-2007 04:54 AM shivanangel Vizard 3 04-07-2006 08:45 AM

All times are GMT -7. The time now is 06:43 AM.

 Contact Us - WorldViz Home - Archive - Top

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC