WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-09-2004, 01:16 PM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
SEOS HMD 120/67 compatability

Hello...

What is the screen resolution output for Vizard?

I need dual SXGA for my SEOS HMD, Is it possible to set this up?

Also i need to change the viewpoints for each channel - The HMD has a 120H and 67V FOV with a 50% stereo overlap. How do i do this?

I'm not really familiar with VRML or Python....But learning..

Any help greatly appreciated.
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #2  
Old 02-11-2004, 09:56 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Right...well i've done it..

But i'm not sure if what i have done is correct. It's looks OK on the HMD, but is there a way of setting Vizard to default to what i want?

At the moment i have reworked the window tutorial and positioned the windows how i want them. I'm sure this isn't the best way of going about it, because it is still rendering the main window.

Basically is there anyway i can change the main window so that it will always default to run on my HMD


Here is my (very messy) code

# WorldViz © 2002============================================== =======
#
# This script demonstrates how to create extra windows and viewports.
# Extra windows let you render "mini"-screens superimposed on top of
# the normal graphics window which can either show variations of the
# primary view (say at wide angle), or can show an entirely different
# view (say a bird's eye view of the terrain).
#
# In this example, the upper left corner shows a bird's eye view of
# the room, while the upper right corner shows a rear view of our
# current position.
#
#================================================= ====================

import viz

viz.go(viz.STEREO | viz.FULLSCREEN)
viz.displaymode(2560, 1024, 16, 60)

#Add the room, rope, and arrow
#room = viz.add('../vrmls/gallery.wrl')
sphere = viz.add('../vrmls/sphere_VRML97.wrl')
#rope = viz.add('../vrmls/guardrope.wrl')
#arrow = viz.add('../vrmls/arrow.wrl')

# Create a new window in the left side
LeftWindow = viz.add(viz.WINDOW)
LeftWindow.position(0.0, 1.0)
LeftWindow.size(0.5, 1.0)

# Create a new viewpoint
LeftView = viz.add(viz.VIEWPOINT)

#Assign LeftView to left eye ????
#LeftView.scene(2)
#LeftView.scene(2, viz.LEFT_EYE)

#LeftView = viz.viewdist(0.10)
#viz.ipd(-0.06)
#Attach the Left eye view to the left window
LeftWindow.viewpoint(LeftView)


#Create a new window in the right side
RightWindow = viz.add(viz.WINDOW)
RightWindow.position(0.5, 1.0)
RightWindow.size(0.5, 1.0)


#Create another viewpoint
RightView = viz.add(viz.VIEWPOINT)

#assign view to right eye ????
#RightView.scene(1)
#RightView.scene(1, viz.RIGHT_EYE)

#RightView = viz.viewdist(0.10)
viz.ipd(0.06)

#Attach the Right view to the right window
RightWindow.viewpoint(RightView)




#Increase the field-of-view for the window so that the rear view has a wide angle
RightWindow.fov(67,0.64)
LeftWindow.fov(67,0.64)

def mytimer(num):
#Get the current head orientation and position
ori = viz.get(viz.VIEW_YAW)
pos = viz.get(viz.HEAD_POS)


#Rotate the view so that it looks -20 degrees
LeftView.rotate(0,1,0,ori-20)
#Move the view
LeftView.translate(pos)


#Rotate the rear view so that it looks + 20 degrees
RightView.rotate(0,1,0,ori+20)
#Move the view
RightView.translate(pos)



#Move the arrow to our current location
#arrow.translate(pos[0],0,pos[2])
#arrow.rotate(0,1,0,ori)

# Create callback to a timer and start it
viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,-1)

# Turn on collision detection so we can't go through walls
viz.collision(viz.ON)

# Disable collisions with the arrow
#arrow.disable(viz.COLLISION)
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.

Last edited by John; 02-11-2004 at 12:25 PM.
Reply With Quote
  #3  
Old 02-11-2004, 10:02 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Also....

Does anyone know why the duck demo does not work??

Here is my error message

Traceback (most recent call last):
File "<string>", line 2, in ?
File "duckcourt.py", line 5, in ?
viz.go()
File "C:\Program Files\Vizard20\viz.py", line 1109, in go
exec element + ' = viz.addgroup()' in _GlobalDict
File "<string>", line 1, in ?
NameError: name 'court1' is not defined
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #4  
Old 02-11-2004, 04:08 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Here is a sample script that performs overlapped stereo. Adjust the variable OVERLAP to 0.5 for 50% overlap. Also, keep in mind that this script uses an intersense for head movement:
Code:
import viz
import vizmat

VERT_FOV		= 50
HORZ_FOV		= 50 * 1.3
HORZ_2_VERT_ASPECT	= 1.0
OVERLAP			= 0.5
IPD			= 0.1

viz.go()

ori = viz.add('intersense.dls')
ori.reset()

X = vizmat.Transform()

#Add the room
room = viz.add('../vrmls/gallery.wrl', viz.WORLD, 2)

# Create a new window in the upper left corner
UpperLeftWindow = viz.add(viz.WINDOW)
UpperLeftWindow.position(0, 1.0)
UpperLeftWindow.size(0.5, 1.0)
UpperLeftWindow.fov(50, HORZ_2_VERT_ASPECT)

#Create a new window in the upper right corner
UpperRightWindow = viz.add(viz.WINDOW)
UpperRightWindow.position(0.5, 1.0)
UpperRightWindow.size(0.5, 1.0)
UpperRightWindow.fov(50, HORZ_2_VERT_ASPECT)

LeftView = viz.add(viz.VIEWPOINT)
LeftView.scene(2)

RightView = viz.add(viz.VIEWPOINT)
RightView.scene(2)

UpperLeftWindow.viewpoint(LeftView)
UpperRightWindow.viewpoint(RightView)

angle = 0.0
def mytimer(num):
	global angle
	
	data = ori.get()
	yaw = data[3]
	pitch = data[4]
	roll = data[5]
	
	angle += .1
	X.makeEuler(yaw + HORZ_FOV*(1-OVERLAP)/2, pitch, roll)
	X.invertOrthoNorm()
	X.preTrans(-IPD, 0, 0)  # pretrans correct for stereo
	X.postTrans(0, 1.8, 0)
	LeftView.update(X)

	X.makeEuler(yaw - HORZ_FOV*(1-OVERLAP)/2, pitch, roll)
	X.invertOrthoNorm()
	X.preTrans(IPD, 0, 0)
	X.postTrans(0, 1.8, 0)
	RightView.update(X)
	
def mykeyboard(key):
	if key == '1':
		UpperRightWindow.visible(0)
	if key == '2':
		UpperRightWindow.visible(1)
		
viz.callback(viz.KEYBOARD_EVENT, mykeyboard)	
	
# Create callback to a timer and start it
viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,-1)

# Turn on collision detection so we can't go through walls
viz.collision(viz.ON)
Also, to fix the duckcourt demo, go to the duckcourt directory and delete the file duckcourt.viz. This was a mistake in the last version and will be fixed in the next version.
Reply With Quote
  #5  
Old 02-12-2004, 03:04 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Excellent, Thank you Farshizzo.

It needed modifying slightly (FOV etc) but it works great.

I have a couple of questions..

What does the viz.WORLD, 2 relate to? - i think the 2 is the scenes, but i can't find any info on viz.WORLD in the help files (BTW is there a more comprehensive book for Vizard)

Why can't i intergrate this code into some demos when i can integrate it into others

For example i managed to get the scaffod to work and i managed to the court1 and doorways of duckcourt to work (all tracked) but why don't they work properly..

Is it to do with fact that the parts that aren't showing are moving and their positions are conflicting with the Tracker?

Thanks again for your help.

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #6  
Old 02-12-2004, 07:11 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Hello,

Sorry to be a pain, but i have another problem...

With the tracker on (Intersense) both viewpoints track independantly of each other. This isn't so obvious with the heading or pitch, but when you tilt your head to either side both viewpoints roll around their own axis causing problems.

Is there a simple fix for this?

Thanks

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #7  
Old 02-12-2004, 09:52 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi John,

When adding objects in vizard you can add them to either the WORLD, HEAD, or SCREEN. By default vizard adds them to the WORLD. The 2 is simply adding it to the second scene. The reason other scripts don't work with this is because the other objects are being added to scene 1, which is the default. I thought about this and there is no reason to be using a second scene in this example. Change the following line:
Code:
room = viz.add('../vrmls/gallery.wrl', viz.WORLD, 2)
to:
Code:
room = viz.add('../vrmls/gallery.wrl')
Also remove the following two lines:
Code:
LeftView.scene(2)
RightView.scene(2)
Now it should work with other scripts.

As for your other problem. The viewpoints are being modified independently, but they are using the same data. So they should be tilting upon the same axis. What problems are you experiencing?
Reply With Quote
  #8  
Old 02-12-2004, 12:06 PM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
I'll try and explain...


Each viewpoint rolls on it's own independant axis. This would be fine for 100% overlap beacuse both viewpoints are showing the same thing and have a common centre axis.

However with the 50% overlap each viewpoint has a slightly different image and when they rotate independantly it causes the stereo image to 'split' Imagine 2 pieces of paper on the desk, that are overlapped by 50%, if you rotate each one independantly about it's own centre axis then they don't lie on top of each other anymore. But if you see the two pieces of paper as one large piece of paper, you would need to rotate it from the 'large' piece of papers cetre axis to keep it the same shape. I apologise if this sound patronising.. i can't think of another way to explain it!

What i think needs to happen is that the pivot point for the tracker needs to be offset 25% towards the right for the left eye and 25% towards the left for the right eye. But i don't know how to do it.
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #9  
Old 02-12-2004, 12:24 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi John,

I modified the previous code so that when you press the 'p' key it will print out the X and Y position of each viewpoint. When I run this script here and tilt the viewpoint 90 degrees. The X position of both viewpoints are equal and the Y positions differ by the IPD distance, which means the viewpoints lie on top of each other. Can you try running this script to make sure you are getting similar results?
Code:
import viz
import vizmat

VERT_FOV		= 50
HORZ_FOV		= 50 * 1.3
HORZ_2_VERT_ASPECT	= 1.0
OVERLAP			= 0.5
IPD			= 0.1

viz.go()

ori = viz.add('intersense.dls')
ori.reset()

X = vizmat.Transform()

#Add the room
room = viz.add('../vrmls/gallery.wrl')

# Create a new window in the upper left corner
UpperLeftWindow = viz.add(viz.WINDOW)
UpperLeftWindow.position(0, 1.0)
UpperLeftWindow.size(0.5, 1.0)
UpperLeftWindow.fov(50, HORZ_2_VERT_ASPECT)

#Create a new window in the upper right corner
UpperRightWindow = viz.add(viz.WINDOW)
UpperRightWindow.position(0.5, 1.0)
UpperRightWindow.size(0.5, 1.0)
UpperRightWindow.fov(50, HORZ_2_VERT_ASPECT)

LeftView = viz.add(viz.VIEWPOINT)

RightView = viz.add(viz.VIEWPOINT)

UpperLeftWindow.viewpoint(LeftView)
UpperRightWindow.viewpoint(RightView)

angle = 0.0
def mytimer(num):
	global angle
	
	data = ori.get()
	yaw = data[3]
	pitch = data[4]
	roll = data[5]
	
	angle += .1
	X.makeEuler(yaw + HORZ_FOV*(1-OVERLAP)/2, pitch, roll)
	X.invertOrthoNorm()
	X.preTrans(-IPD, 0, 0)  # pretrans correct for stereo
	X.postTrans(0, 1.8, 0)
	LeftView.update(X)

	X.makeEuler(yaw - HORZ_FOV*(1-OVERLAP)/2, pitch, roll)
	X.invertOrthoNorm()
	X.preTrans(IPD, 0, 0)
	X.postTrans(0, 1.8, 0)
	RightView.update(X)
	
def mykeyboard(key):
	if key == '1':
		UpperRightWindow.visible(0)
	if key == '2':
		UpperRightWindow.visible(1)
	if key == 'p':
		print 'X Position: Left',LeftView.get(viz.HEAD_POS)[0]
		print 'X Position: Right',RightView.get(viz.HEAD_POS)[0]
		print 'Y Position: Left',LeftView.get(viz.HEAD_POS)[1]
		print 'Y Position: Right',RightView.get(viz.HEAD_POS)[1]
		
viz.callback(viz.KEYBOARD_EVENT, mykeyboard)	
	
# Create callback to a timer and start it
viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,-1)

# Turn on collision detection so we can't go through walls
viz.collision(viz.ON)
Reply With Quote
  #10  
Old 02-12-2004, 01:41 PM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Hi Farshizzo,

Yes i will do that tomorrow. I am in the UK and it is 9.30pm so i'm not at work.

Maybe it is to do with the modifications i made to the FOV - i haven't got the code with me at the moment and i can't remember exactly what i did.

I think i changed this bit (changes in brackets)

VERT_FOV = 50 (67)
HORZ_FOV = 50 (67)* 1.3
HORZ_2_VERT_ASPECT = 1.0 (1.3)
OVERLAP = 0.5
IPD = 0.1 (0.06)

and this bit

UpperLeftWindow.fov(50(67), HORZ_2_VERT_ASPECT)
.
.
.
.
.
UpperRightWindow.fov(50(67), HORZ_2_VERT_ASPECT)

However i could be wrong. I will check everything in the morning and get back to you.

What does the angle bit do within mytimer? can't figure it out.

Thanks again for your help. Appreciated

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.

Last edited by John; 02-12-2004 at 02:48 PM.
Reply With Quote
  #11  
Old 02-12-2004, 01:45 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi John,

The angle stuff is junk, you can delete it.
Reply With Quote
  #12  
Old 02-13-2004, 01:26 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Hi Farshizzo,

I get the same values as you do. both x axis the same and both y the same.

But this is wrong.

If you run the code you will see what i mean. If you look at a picture on the wall. Then tilt by 90 degrees, because the viewpoints are looking at different things one picture will end up lower in the viewport and one will end up higher. Try it, you should see what i mean.

What i think we need is something like a 1 x 1 pixel window that handles all the x,y,z - h,p,r information then 2 clones at full size that are looking at different angles (-20 left and +20 Right). I know this can be done in Performer because that is what we have runninb on the HMD at the moment.

I think the key thing is that both windows aren't showing the same area of the image but, as we have just demonstrated both windows are rotating about the same point.


Imagine it as tilting your eyeballs instead of tilting your head.

Regards

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #13  
Old 02-18-2004, 05:52 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi John,

Sorry for the late reply, I took the last few days off. Anyway, I believe I understand your problem now. I've attached the new code. When we release the next version of Vizard, the overlap will be a built-in command, so you won't have to do any of this manual calculation. Let me know if this is correct:
Code:
import viz
import vizmat

VERT_FOV			= 50
HORZ_FOV			= 50 * 1.3
HORZ_2_VERT_ASPECT	= 1.0
OVERLAP				= 0.5
IPD					= 0.1

viz.go()

ori = viz.add('intersense.dls')
ori.reset()

X = vizmat.Transform()

#Add the room
room = viz.add('../vrmls/gallery.wrl')

# Create a new window in the upper left corner
UpperLeftWindow = viz.add(viz.WINDOW)
UpperLeftWindow.position(0, 1.0)
UpperLeftWindow.size(0.5, 1.0)
UpperLeftWindow.fov(50, HORZ_2_VERT_ASPECT)

#Create a new window in the upper right corner
UpperRightWindow = viz.add(viz.WINDOW)
UpperRightWindow.position(0.5, 1.0)
UpperRightWindow.size(0.5, 1.0)
UpperRightWindow.fov(50, HORZ_2_VERT_ASPECT)

LeftView = viz.add(viz.VIEWPOINT)

RightView = viz.add(viz.VIEWPOINT)

UpperLeftWindow.viewpoint(LeftView)
UpperRightWindow.viewpoint(RightView)

def mytimer(num):
	data = ori.get()
	yaw = data[3]
	pitch = data[4]
	roll = data[5]
	
	X.makeEuler(yaw, pitch, roll)
	X.invertOrthoNorm()
	X.preTrans(-IPD, 0, 0)  # pretrans correct for stereo
	X.postTrans(0, 1.8, 0)
	X.preRot(0,1,0, -HORZ_FOV*(1-OVERLAP)/2)
	LeftView.update(X)

	X.makeEuler(yaw, pitch, roll)
	X.invertOrthoNorm()
	X.preTrans(IPD, 0, 0)
	X.postTrans(0, 1.8, 0)
	X.preRot(0,1,0, HORZ_FOV*(1-OVERLAP)/2)
	RightView.update(X)
	
def mykeyboard(key):
	if key == '1':
		UpperRightWindow.visible(0)
	if key == '2':
		UpperRightWindow.visible(1)
	if key == 'p':
		print 'X Position: Left',LeftView.get(viz.HEAD_POS)[0]
		print 'X Position: Right',RightView.get(viz.HEAD_POS)[0]
		print 'Y Position: Left',LeftView.get(viz.HEAD_POS)[1]
		print 'Y Position: Right',RightView.get(viz.HEAD_POS)[1]
		
viz.callback(viz.KEYBOARD_EVENT, mykeyboard)	
	
# Create callback to a timer and start it
viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,-1)

# Turn on collision detection so we can't go through walls
viz.collision(viz.ON)
Reply With Quote
  #14  
Old 02-19-2004, 01:34 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Hi Farshizzo,

Thanks for the reply.

I too am off work now for a few days. I should be back in the office next wednesday. so i will try this code then.

will let you know how it works..

Thanks

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #15  
Old 03-12-2004, 04:17 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Working now

Hi Farshizzo

Sorry for the delay in replying, we haven't had a HMD to test it with until today.

I've tested it now though and it works perfectly. Thank you for your help.

The HMD kinda makes you feel a liitle bit queezy when it is being used with your databases!!... which proves the immersion in the environment is very good.

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #16  
Old 03-12-2004, 09:55 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi John,

Thanks for testing it out. Now that I know it works I've implemented it into Vizard. So from the next version (2.15) and on all you have to do is the following:
Code:
#Use 50% stereo overlap
viz.stereooverlap(0.5)
Reply With Quote
  #17  
Old 03-19-2004, 02:10 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
Hi Farshizzo,

Just a note.

If you are including these settings into the next version of Vizard, then there are a couple of settings that we change. These are to do with the field of view:


VERT_FOV = 67
HORZ_FOV = 67 * 1.19 # gives 67 x 80 FOV
HORZ_2_VERT_ASPECT = 1.25 # 1280/1024
OVERLAP = 0.5
IPD = 0.1

...

UpperLeftWindow.fov(67, HORZ_2_VERT_ASPECT)

...

UpperRightWindow.fov(67, HORZ_2_VERT_ASPECT)

These settings are specific to the SEOS HMD

Thanks again for your help.

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #18  
Old 05-28-2004, 02:27 AM
John John is offline
Member
 
Join Date: Feb 2004
Location: Brighton - UK
Posts: 12
2.15 release

Hi Farshizzo,

Just a query, Does the 2.15 version of Vizard now include the SEOS HMD settings? Also if i upgrade to this do i need a new licence?

Cheers,

John
__________________
There are only 10 kinds of people who understand binary. Those that do and those that don't.
Reply With Quote
  #19  
Old 05-28-2004, 11:13 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi John,

Yes, the latest version of Vizard on the download page should contains the stereooverlap command. If you already have a license you don't need to get a new one.
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


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


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