#1
|
|||
|
|||
Why I need two points for viz.startlayer(viz.POINTS)
Hi, I want to show the points as mouse moves, and I program like below:
Code:
def plotGraph(x,y): viz.startlayer(viz.POINTS) viz.pointsize(5) # viz.vertexcolor(viz.RED) # viz.vertex(0,0,0) viz.vertexcolor(viz.BLACK) viz.vertex(x,y,0) line = viz.endlayer(viz.SCREEN) print 'plot',x,y def onMouseMove(e): plotGraph(e.x,e.y) viz.go() viz.clearcolor(viz.SKYBLUE) viz.callback(viz.MOUSE_MOVE_EVENT,onMouseMove) Code:
viz.vertexcolor(viz.RED) viz.vertex(0,0,0) Can anyone tell me why? Is it because startlayer needs at lease two points? Thank you |
#2
|
|||
|
|||
OpenSceneGraph will cull objects that appear very small on screen. Since you have one point, it is computed as infinitely small on screen and not rendered. You can disable viz.CULLING on the node to prevent this from happening:
Code:
line.disable(viz.CULLING) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Support for Natural Point's Optitrack system | bennovdbogaard | Vizard | 14 | 10-25-2012 07:22 AM |
avatar walking over a sequence of points | IGoudt | Vizard | 1 | 10-16-2009 12:22 PM |
on the fly points | John P | Vizard | 1 | 07-15-2009 06:22 PM |
Draw Line between Points | Chrissy2009 | Vizard | 2 | 05-13-2009 05:42 AM |
Draw Line between Points selected by mouse | Johannes | Vizard | 7 | 01-07-2005 03:50 PM |