View Single Post
  #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