![]() |
|
#1
|
|||
|
|||
Question regarding getEuler and it uses
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. |
#2
|
|||
|
|||
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 command. That will help you determine which cue(s) are in the center area of the view at any given time.
|
#3
|
|||
|
|||
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.
|
#4
|
|||
|
|||
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? |
#5
|
|||
|
|||
One more question, how do i know which coordinates to put to my rectangle?
|
#6
|
|||
|
|||
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 or window.pickRect. 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.
|
#7
|
|||
|
|||
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. |
#9
|
|||
|
|||
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. |
#10
|
|||
|
|||
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. |
#11
|
|||
|
|||
Quote:
Code:
''' 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) |
#12
|
|||
|
|||
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. |
#13
|
|||
|
|||
Quote:
Code:
view = viz.MainView pos = view.getPosition() ori = view.getEuler() Last edited by Jeff; 10-26-2016 at 05:19 PM. |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
getPosition and getEuler using oculus with xbox or keyboard | bbb | Vizard | 3 | 01-13-2016 06:52 AM |
MainView and getEuler | shivanangel | Vizard | 1 | 01-20-2012 10:31 AM |
Problem with getEuler and setEuler | Sandro Holzer | Vizard | 6 | 10-21-2008 05:01 AM |