WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-03-2007, 08:10 PM
AlyssaK AlyssaK is offline
Member
 
Join Date: Dec 2006
Posts: 16
Question Fix the positon of objects on a scene

Hi everyone,

I have inserted the text "X" within a cube (the cube is similar to one of the tutorials). I'm interested in fixing the location of this within the cube. I would also like to allow the user to navigate throughout the scene without affecting the fixed positions.

Can you point me in the right direction?

I've tried this:

hole1 = cube.add(viz.TEXT3D, "X")
hole1.setScale(0.3,0.3,0.3)
hole1.setPosition(0.4,1.0,4)

It still affects the location when zooming in etc.

Thanks.

P.S. sorry couldn't think of a better topic description for this question...
Reply With Quote
  #2  
Old 01-04-2007, 01:18 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
It seems like your code does what you want to do. Try my code and let me know if this is what you want.

Code:
import viz
viz.go()

cube = viz.add('box.wrl')
hole1 = cube.add(viz.TEXT3D, "X")
hole1.setScale(0.3,0.3,0.3)
hole1.setPosition(0.4,1.0,4)
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
  #3  
Old 01-07-2007, 10:52 PM
AlyssaK AlyssaK is offline
Member
 
Join Date: Dec 2006
Posts: 16
Thanks for your post.

My initial intention was to fix the position of the point's (X's) on the cube and to maintain this scale when zooming in and out.

I realised that a simple solution (for this stage) was to disable mouse navigation.

If you happen to come across a solution for this please post a response.

Thanks
Reply With Quote
  #4  
Old 01-08-2007, 09:13 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
I see...

The solution here is to use the worldToScreen fuction and add the text to the screen. Update the position of the text on the screen every frame with the worldToScreen fucntion.
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
Reply


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 11:22 AM.


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