PDA

View Full Version : vizcave coordinates


Rennschu
11-02-2015, 06:19 AM
Hello,

I am using a 3DMonitor with shutter-glasses and a chinrest to stable the user's head. I use vizcave since I want to apply an asymmetric view frustrum. I would like to set the origin of the coordinate system to the upper left corner of my display (because this is the coordinate system my eye-tracker uses). However, my code does not seem to set the origin to the display corner.

import viz
import vizshape
import vizcave
import viztracker

width = 0.60
height = 0.335
distance = 0.70

PowerWall = vizcave.Wall(upperLeft=(0,0,0), upperRight=(width,0,0), lowerLeft=(0,-height,0), lowerRight=(width, -height, 0))

viz.go(viz.QUAD_BUFFER|viz.FULLSCREEN)

cave = vizcave.Cave()
cave.addWall(PowerWall)

head_tracker = viztracker.Keyboard6DOF()
head_tracker.setPosition (width/2, -height/2, -distance)
cave.setTracker(head_tracker)


What am I doing wrong? Could I set the origin to the display corner? If yes, how?

Also, I noticed, that although I used meters to specify the positions, my scaled objects seem to have the wrong size (far smaller). What do I need to consider concerning scale?


Greetings,
Rebekka

Jeff
11-02-2015, 12:31 PM
How are you determining the origin is not set properly? Try setting the origin to be directly below the user's head on the ground. Does that work for you?

Rennschu
11-02-2015, 10:33 PM
I am adding world axes with

world_axes = vizshape.addAxes()
X = viz.addText3D('X',pos=[0.1,0,0],color=viz.RED,scale=[0.3,0.3,0.3],parent=world_axes)
Y = viz.addText3D('Y',pos=[0,0.1,0],color=viz.GREEN,scale=[0.3,0.3,0.3],align=viz.ALIGN_CENTER_BASE,parent=world_axes)
Z = viz.addText3D('Z',pos=[0,0,0.1],color=viz.BLUE,scale=[0.3,0.3,0.3],align=viz.ALIGN_CENTER_BASE,parent=world_axes)


The world axes are not displayed in the upper left corner of the display, but somewhere behind and below the user.
How would I be able to set the upper left corner of the display to the origin of the world axes and define all positions in relation to that point?

Rennschu
11-10-2015, 11:15 PM
Bumping the thread as I've had no reply in over a week.

Do you need any additional information to answer my question?

Jeff
11-11-2015, 04:58 PM
Does it work as expected if you set the origin to be just below the user and calculate the wall coordinates from that location?

Rennschu
11-12-2015, 04:24 AM
Hi Jeff and everyone,

I found my mistake. I realized, I have to additionally set up a link between the head tracker and the main viewpoint as described in this thread:

http://forum.worldviz.com/showthread.php?t=4454&highlight=vizcave

Adding this line solved my problem:
vizcave.CaveView(head_tracker)

Thanks,
Rebekka