WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-28-2011, 07:59 AM
jincheker jincheker is offline
Member
 
Join Date: Oct 2009
Posts: 15
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)
The problem is if i comment
Code:
viz.vertexcolor(viz.RED)
viz.vertex(0,0,0)
The code won't work, but if I uncomment them, then it works.
Can anyone tell me why? Is it because startlayer needs at lease two points?

Thank you
Reply With Quote
  #2  
Old 01-28-2011, 09:46 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 12:47 PM.


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