![]() |
#1
|
|||
|
|||
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) Code:
crosshair = viz.add(viz.TEXQUAD) crosshair.texture(viz.add('crosshair.tif')) crosshair.scale(0.01,0.01,0.01) 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)) |
#2
|
|||
|
|||
Hi,
The following code should fix it. Code:
viz.clip(0.01,1000) |
#3
|
|||
|
|||
THANK YOU! That worked perfectly
|
#4
|
|||
|
|||
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?
|
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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?
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|