WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
  #1  
Old 05-04-2006, 09:29 AM
wolbers wolbers is offline
Member
 
Join Date: Apr 2006
Location: Santa Barbara
Posts: 8
perspective rendering

Hi,
is it possible to automatically scale the size of on-the-fly objects to convey depth impression? I have created a ground plane consisting of points, but Vizard applies the same pointsize to each point, independent of the distance to the observer.

Best,
Thomas
Reply With Quote
  #2  
Old 05-04-2006, 10:30 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

If you want the points to be scaled by distance then try using a billboarded quad instead of On-The-Fly objects. Here is some code:
Code:
quad = viz.add(viz.TEXQUAD)
quad.billboard()
quad.scale(0.2,0.2,0.2) #Need to scale it only once
quad.translate(x,y,z) #Position the quad
Now perspective rendering will work correctly on the points

If you plan on using a lot of points then this might not be the most effiecient solution. If this is the case, then there is an alternative solution which requires a plugin. However, try this method first and let me know if it is sufficient.
Reply With Quote
  #3  
Old 05-04-2006, 11:19 AM
wolbers wolbers is offline
Member
 
Join Date: Apr 2006
Location: Santa Barbara
Posts: 8
Thanks for your suggestion. Your solution worked fine, however, given that I need 2000-3000 points, the animation was somewhat slowed down. Do you think the plugin could handle that?
Reply With Quote
  #4  
Old 05-04-2006, 11:24 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Quote:
Do you think the plugin could handle that?
Not sure, but it will definitely handle better than using 2000 billboarded quads. Are the position of the points static or dynamic. If they are static then you shouldn't need a plugin.
Reply With Quote
  #5  
Old 05-04-2006, 11:39 AM
wolbers wolbers is offline
Member
 
Join Date: Apr 2006
Location: Santa Barbara
Posts: 8
They are all dynamic - from frame to frame, some points will be redrawn at random locations, whereas others will be slightly displaced along the z-axis.
Reply With Quote
  #6  
Old 05-04-2006, 12:50 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

I've attached a zip file which contains a plugin and sample script on how to use it. The points should have some form of perspective rendering on them.
Attached Files
File Type: zip LightPointPlugin.zip (6.4 KB, 1031 views)
Reply With Quote
  #7  
Old 05-04-2006, 03:37 PM
wolbers wolbers is offline
Member
 
Join Date: Apr 2006
Location: Santa Barbara
Posts: 8
Hi,

thank you so much - the plug-in works fine. I have, however, observed that the speed with which the points change position depends on how far backwards you move the viewpoint. I guess my limited knowledge of Vizard prevents me from understanding this - is there a way to get around it?
Reply With Quote
  #8  
Old 05-08-2006, 11:18 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The example code that changes the position of the points uses the actual elapsed time to calculate the new position, so it shouldn't be framerate dependent. Press the F4 key to display the framerate of you simulation in the upper left corner of the window. It should usually be around 60 fps. When you move further back does the framerate drop?
Reply With Quote
  #9  
Old 05-10-2006, 11:02 AM
wolbers wolbers is offline
Member
 
Join Date: Apr 2006
Location: Santa Barbara
Posts: 8
Yes, the closer I move the viewpoint towards the dots, the lower the framerate. Could that have anything to do with my graphics card (ATI FireGL V3200)?
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 06:20 PM.


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