WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-10-2006, 12:21 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Importing Scaffold scene

I have a slight problem. Farshizzo has so kindly helped me with using the crosshair as a 3d object. The problem is that I am also trying import the scaffold scene. The problem I'm having is that when I insert the scaffold scene the crosshair disappears. I'm thinking it has to do w/the textures, but I'm not sure. Is it possible to use the crosshair with the scaffold?

Here is the code I used to insert the scaffold scene:
Code:
sunlight = viz.add(viz.LIGHT)
sunlight.position(10,10,-20)
sunlight.direction(-0.5,-0.5,1)
sunlight.color(1,1,1)

sky = viz.add('skydome.dlc',0,'',15)
env = viz.add(viz.ENVIRONMENT_MAP,'sky.bmp')
sky.texture(env)
sky.disable(viz.FOG)

#Add 3D objects
panorama = viz.add('full_cyl1.wrl')
#ground   = viz.add('bottom.wrl')
#scaffold = viz.add('scaffold2.wrl')


court = viz.add('scaffold2.wrl')
court.scale(0.5,0.5,0.5)
court.rotate(0,1,0,-90)
court.translate(-5,0,-10)
court.appearance(viz.MODULATE)
court.disable(viz.LIGHT0)
Here is the code for the crosshair insertion:
Code:
crosshair = viz.add(viz.TEXQUAD)
crosshair.texture(viz.add('crosshair.tif'))
crosshair.scale(0.01,0.01,0.01)
Here is the code to control the movement of the crosshair (within a timer):
Code:
	linepos = viz.mousepos()
	#line = viz.screentoworld(viz.mousepos())
	line = viz.screentoworld(linepos[0]+.11,linepos[1])
	v = viz.Vector(viz.get(viz.HEAD_POS))
	dir = viz.Vector(line[3:]) - viz.Vector(line[:3])
	dir.normalize()
	dir *= 0.1 #Place crosshair 1/10th meter in front of user
	v += dir
	crosshair.translate(v.get())
	crosshair.rotatequat(viz.get(viz.VIEW_QUAT))
Reply With Quote
  #2  
Old 04-10-2006, 12:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The following code should fix it.
Code:
viz.clip(0.01,1000)
Reply With Quote
  #3  
Old 04-10-2006, 12:44 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
THANK YOU! That worked perfectly
Reply With Quote
  #4  
Old 04-10-2006, 02:01 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
Crosshair problem

One thing that was weird is that the crosshair shows up separately on each eye when I put on the HMD. Is there a way to fix this?
Reply With Quote
  #5  
Old 04-10-2006, 02:27 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

I'm not sure what you mean. When you view a scene in stereo ALL objects should be showing up separately in each eye. If an object only appears on one eye then you lose the stereo effect.
Reply With Quote
  #6  
Old 04-10-2006, 02:39 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
What I mean is that 2 crosshairs appear, both showing up on the screen at the same time. The problem is that when I click, bullets come out of the left eye, but nothing comes out of the right eye. Is there a way to make both crosshairs match up so that when I point, regardless of which of the 2 crosshairs I'm looking at, I'll get an accurate shot?
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:23 AM.


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