WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   simple question drawing to screen (https://forum.worldviz.com/showthread.php?t=3553)

Kaminski 03-02-2011 09:56 AM

simple question drawing to screen
 
I can't figure out how to draw to screen separately for the LEFT and RIGHT eyes. I just want to make 2-dimensional polygons but have the left and right eyes see completely different views. Heres what I've been trying:

Code:

import viz
viz.go(viz.HMD | viz.SEREO)
viz.startlayer(viz.LINE_LOOP)
viz.vertexcolor(viz.BLUE)
viz.linewidth(1)
viz.vertex(0.2,0.2)
viz.vertex(0.2,0.5)
viz.vertex(0.5,0.5)
viz.vertex(0.5,0.2)
line = viz.endlayer(viz.SCREEN,viz.LEFT_EYE)

I know that last line is flat out wrong, but I can't find how to say it.

farshizzo 03-02-2011 09:59 AM

You can use the viz.RENDER_RIGHT and viz.RENDER_LEFT flags to prevent a node from rendering to a specific eye in stereo. In your example, if you wanted the line to only show up on the left eye, then you would use the following code:
Code:

import viz
viz.go(viz.HMD | viz.STEREO)

viz.startlayer(viz.LINE_LOOP)
viz.vertexcolor(viz.BLUE)
viz.linewidth(1)
viz.vertex(0.2,0.2)
viz.vertex(0.2,0.5)
viz.vertex(0.5,0.5)
viz.vertex(0.5,0.2)
line = viz.endlayer(viz.SCREEN)
line.disable(viz.RENDER_RIGHT)


Kaminski 03-02-2011 11:03 AM

Thats it, thanks.


All times are GMT -7. The time now is 02:11 PM.

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