View Single Post
  #1  
Old 01-10-2014, 02:43 AM
Notch Notch is offline
Member
 
Join Date: Jan 2014
Posts: 15
Create image directly in front of head

I'd like to create a vision-occluding polygon that hangs directly in front of the virtual user's head. I need to be able to manipulate the position of this polygon, so that it covers different parts of the view depending on where I move it. By default, it will cover exactly half of the view.

I've managed to generate a polygon that is head-attached, but it seems to hang directly through the centre of the "eyes", such that the player can see through the plane. In other words, the plane does not occlude the view, but can be seen if you look around.

How can I code this plane to sit slightly further forwards, so that it obscures the view of the world? Here's what I'm using at the moment ('scotoma.png' is simply a 128x128 coloured square):

Code:
scotoma = viz.addTexture('scotoma.png')
quad = viz.addTexQuad(parent=viz.HEAD, texture=scotoma,size=50)
I've tried using the following to manipulate the position of the polygon:

Code:
quad.setPosition(quad.getPosition() + [0, 10, 0])
... But it doesn't seem to shift the polygon at all.

Any ideas? It's important that the polygon is head-relative, as I need to shift it around a little bit from time to time.

Any help would be greatly appreciated.
Reply With Quote