WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-30-2016, 03:51 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
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.
Reply With Quote
  #2  
Old 08-31-2016, 04:40 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #3  
Old 08-31-2016, 06:57 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #4  
Old 09-14-2016, 02:22 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
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?
Reply With Quote
  #5  
Old 09-14-2016, 02:28 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
One more question, how do i know which coordinates to put to my rectangle?
Reply With Quote
  #6  
Old 09-15-2016, 06:20 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #7  
Old 09-19-2016, 06:09 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
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.
Reply With Quote
  #8  
Old 09-20-2016, 07:35 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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 library related to angles.
Reply With Quote
  #9  
Old 10-12-2016, 11:24 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
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.
Reply With Quote
  #10  
Old 10-12-2016, 11:38 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
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.
Reply With Quote
  #11  
Old 10-19-2016, 04:12 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Quote:
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:

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)
Reply With Quote
  #12  
Old 10-25-2016, 06:01 AM
bbb bbb is offline
Member
 
Join Date: Nov 2015
Posts: 46
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.
Reply With Quote
  #13  
Old 10-26-2016, 05:17 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Quote:
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:

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

Last edited by Jeff; 10-26-2016 at 05:19 PM.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Similar Threads
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


All times are GMT -7. The time now is 12:05 PM.


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