View Single Post
Old 02-26-2014, 06:46 AM
Notch Notch is offline
Join Date: Jan 2014
Posts: 15
Create object with position relative to user head, but cannot be obstructed by others

I'm trying to simulate what it's like to have a form visual impairment. The condition causes 'holes' in the vision. For a basic form of this, I'd like to create an occluding quad that 'floats' in front of the user's viewpoint and covers anything seen.

My current solution is to create a quad with viz.HEAD as the parent. However, if I create this quad at exactly [0,0,0] from viz.HEAD, it is not seen. I need to shift the quad a few mm forward in order for it to be seen. Presumably, WorldViz models the 'eyes' of the user slightly in front of [0,0,0] of viz.HEAD.

So, I created a quad that 'floats' 25cm in front of the user's head, partially obscuring the view. This works nicely, and moves whenever I move the head. The trouble is, if I walk up to an object or wall, the wall 'pops through' the floating quad, so that it can be seen. I need the obscuring veil to cover everything in view, regardless of how close objects come.

I know that I could make the quad's parent viz.SCREEN. The problem with that is that the condition I'm trying to simulate is a dynamic one; the visual occlusion actually shifts depending on the position of the body, so I need to have active control over the position of the veil relative to the user's head.

I thought one solution might be to create a vizshape.Box and have this hang relative to the user's head. As a three-dimensional shape, I could have it cover all the area from [0,0,0] out to a few centimetres in front, which would circumvent the weird issue that causes a quad to be invisible unless it is a certain distance in front of the user. The difficulty with this approach is that I don't know how to lock the position of a 3D shape to viz.HEAD.

Is there any way of locking a vizshape to the parent 'viz.HEAD', or can anyone offer any creative solutions?

Any advice would be appreciated.
Reply With Quote