PDA

View Full Version : Question regarding getEuler and it uses


bbb
08-30-2016, 03:51 AM
Hi Jeff and everybody,
I'm using vizard 5.3 with Oculus Rift DK2, runtime 0.8 and xbox one controller.
I built a configuration file via vizconnect in this order: Tracker - DK2 -> Transport -Walking with the xbox keys (up,down,left,right)-> Transport - Orientation with the left toggle (rotate left and right) -> Display - DK2 and AVATAR - hand and head.
I have a scene that i created in sketchup and imported it into vizard. In these scene i have a room with 4 cues on 4 walls (one cue per wall) and participants needs to go to a target location inside the room while using the cues to find the place.
I'm using viz.MainView.getEuler to get orientation of the participant and write it to a text file. I want to know which cue/s participants are looking when trying to get to target location so i care only about the yaw. I want to ask if it's right to refer to yaw rotation as the angle participants are looking at and know the cue they are looking at based on yaw?
Another question, if i'm looking on the same cue but from different location in the room (different positions), will i get the same yaw rotarion angle?
If it's not the way to know that, is there a way to know that without eye tracking?

Thanks in advence.

Jeff
08-31-2016, 04:40 AM
The yaw component of the user's head orientation will change as they look at the cue from different parts of the room. Take a look at the window.pickRect (http://docs.worldviz.com/vizard/#commands/window/pickRect.htm) command. That will help you determine which cue(s) are in the center area of the view at any given time.

Jeff
08-31-2016, 06:57 AM
One thing to keep in mind is that window.pickRect will return all nodes in the specified area, whether or not they are obscured by other models. So it may return a cue that is not visible but directly behind a wall that is.

bbb
09-14-2016, 02:22 AM
Thanks Jeff!
Is there a way to get that information from the tracker? I mean if there is a way to get the angle participants are looking at, at any given time and to know from that which cues they are looking at?
Does the the <hmd>.getSensor can help me with that? or the only suggestion is the window.pickRectangle as you suggested earlier?

bbb
09-14-2016, 02:28 AM
One more question, how do i know which coordinates to put to my rectangle?

Jeff
09-15-2016, 06:20 AM
Is your goal to determine what object(s) are in the center or central area of the viewport? If so, then the easiest solution is to use window.pick (http://docs.worldviz.com/vizard/#commands/window/pick.htm) or window.pickRect (http://docs.worldviz.com/vizard/#commands/window/pickRect.htm). To get the object directly in the center use the pick command with pos value of [0.5,0.5]. The coordinates used in the pickRect command depend on how much of the window you're interested in getting objects from.

bbb
09-19-2016, 06:09 AM
I have 2 goals:
1) to know which cue/s(object/s) participants are looking for navigation to a target goal in the room.
2) to see if there is a correlation between the participants location (position) and the angle participants are looking at (object/s in that direction).
I think that from your description window.pick or window.pickRect can help me with my first goal. How do i get the information in order to achive the second goal (i'm using viz.MainView.getPosition for the participant location)?

You are very helpfull, thank you for your replies.

Jeff
09-20-2016, 07:35 AM
2) At any given time you can get the view position, orientation, and objects that are in view. There are some functions in the vizmat (http://docs.worldviz.com/vizard/#commands/vizmat/AngleToPoint.htm) library related to angles.

bbb
10-12-2016, 11:24 AM
Hi Jeff,
I try to use viz.mainview.pickrect as you suggested but the problem is that it gives me nodes that doesn't mean anything to me like viz.vizchild(18). My question is: if i will change my nodes names in the inspector to meaningful names such as sqaure for square object it will give me meaningful names?

Thanks.

bbb
10-12-2016, 11:38 AM
Regarding your reply for the second goal, i didn't understand how does it help me.
I can be in a certain place in the space but i can look to a completly different place. As far as i understand these function give me the angle between two points in space which relates to change in degrees in my location.
Since you already answered me that viz.mainview.geteuler doesn't help me i believe i need to extract this data from the sensor itself and than maybe convert it with vizmat or maybe another way that i don't know.
I would ask for a clarify please, i'm confused.

Jeff
10-19-2016, 04:12 PM
I try to use viz.mainview.pickrect as you suggested but the problem is that it gives me nodes that doesn't mean anything to me like viz.vizchild(18). My question is: if i will change my nodes names in the inspector to meaningful names such as sqaure for square object it will give me meaningful names?

You can check the nodes returned by the pickRect command against the node names defined in the script:

'''
Press the spacebar to call the pickRect command
'''

import viz
import vizinfo
import vizact
import vizshape

viz.go()

vizinfo.InfoPanel()

#Define pickRect coordinates
LEFT = 0.4
BOTTOM = 0.4
RIGHT = 0.6
TOP = 0.6

viz.move([0,0,-1])

dojo = viz.addChild('dojo.osgb')

pyramid = vizshape.addPyramid(base=(0.2,0.2),height=0.2,pos=[-0.5,1.7,1],alpha=0.7)
torus = vizshape.addTorus(radius=0.1,tubeRadius=0.015,axis =vizshape.AXIS_X, pos=[0,1.7,1])
box = vizshape.addCube(size=0.1, pos=[0.5,1.7,1],alpha=0.8)
pyramid.texture(viz.addTexture('images/tile_slate.jpg'))
torus.texture(viz.addTexture('images/tile_wood.jpg'))

# Visualize the area used by the pick operation
viz.startLayer(viz.LINE_LOOP)
viz.vertex([LEFT, BOTTOM, 0])
viz.vertex([LEFT, TOP, 0])
viz.vertex([RIGHT, TOP, 0])
viz.vertex([RIGHT, BOTTOM, 0])
rectangle = viz.endLayer(parent=viz.SCREEN)
rectangle.alpha(.8)

def pickNodes():

# Get all nodes within the rectangle
picked = viz.MainWindow.pickRect([LEFT,BOTTOM,RIGHT,TOP])
for node in picked:
if node == pyramid:
print 'pyramid picked'
elif node == torus:
print 'torus picked'
elif node == box:
print 'box picked'

vizact.onkeydown(' ',pickNodes)

bbb
10-25-2016, 06:01 AM
1) Thanks for your solution, it helped me achieve my goal as much as possible without eye tracking. I created a shape with vizshape (my objects are static and created in Sketchup so i had to create a shape in the vizard script) while using the position of the region of interest i want to know if people are looking at from the inspector, such that it reports me when people are looking at the 3D shape while using the pickRect.

2) I didn't understand how to correctly use your solution to achieve my second goal, which is to get the correlation between position and orientation. I read about the vizmat module but it seems that the methods relay on previous data such as points, positions, vectors and i don't have previous data that can help. I would appreciate if you can explain furthermore.
Thanks.

Jeff
10-26-2016, 05:17 PM
2) I didn't understand how to correctly use your solution to achieve my second goal, which is to get the correlation between position and orientation. I read about the vizmat module but it seems that the methods relay on previous data such as points, positions, vectors and i don't have previous data that can help. I would appreciate if you can explain furthermore.

I don't understand what you are trying to do. What do you mean by correlation between position and orientation? You can use the following commands to get the viewpoint position and orientation:

view = viz.MainView
pos = view.getPosition()
ori = view.getEuler()