WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-28-2008, 02:55 PM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
frustum versus clip and fov

I'm not understanding the difference (if any) between using the MainWindow.frustum call and the MainWindow.clip and MainWindow.fov calls. I would have expected them to give the same result in the following code, but they don't. Does anyone know why?
Code:
clipPlanes = (0.1,10)
fov = 2*degrees(atan(screenHeight/(2*screenDistance)))
aspectRatio = viz.MainWindow.getSize(viz.WINDOW_PIXELS)[0]/viz.MainWindow.getSize(viz.WINDOW_PIXELS)[1]
topBottom = tan(radians(fov/2))*clipPlanes[0]

viz.MainWindow.clip(clipPlanes)
viz.MainWindow.fov(fov,aspectRatio)

viz.MainWindow.frustum(-aspectRatio*topBottom,aspectRatio*topBottom,-topBottom,topBottom,clipPlanes[0],clipPlanes[1])
Reply With Quote
  #2  
Old 08-28-2008, 03:10 PM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
Oh, nevermind. My bad. These two commands do give the same result. But if you use viz.MainWindow.getSize(viz.WINDOW_PIXELS) before calling viz.go() you (obviously now) don't get the correct numbers. I'm actually glad I had two screens, and two different resolutions, or I might never have noticed that silly mistake.
Reply With Quote
  #3  
Old 08-28-2008, 11:50 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Yes, there are very few commands that are valid prior to viz.go. Thanks for posting your answer.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Jump


All times are GMT -7. The time now is 02:28 PM.


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