![]() |
#1
|
|||
|
|||
![]()
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... |
#2
|
|||
|
|||
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 |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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 |
![]() |
|
|