WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-18-2014, 09:23 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use on-the-fly objects to create the points and lines then add them to a texture quad that is displaying the map. Here is an example:
Code:
import viz
viz.go()

# Points in texture coordinate system
POINTS = [ (0.1,0.2)
		, (0.9,0.2)
		, (0.5,0.8)
]

# Lines in texture coordinate system
LINES = [ [(0.1,0.2), (0.9,0.2)]
		, [(0.1,0.2), (0.5,0.8)]
		, [(0.5,0.8), (0.9,0.2)]
]


# Load map texture
texture = viz.addTexture('ball.jpg')

# Create quad to display texture
quad = viz.addTexQuad(texture=texture, pos=(0,1.5,3))
quad.zoffset(1,1)

# Create points and lines
viz.startLayer(viz.POINTS)
viz.vertexColor(viz.YELLOW)
viz.pointSize(3)
for p in POINTS:
	viz.vertex(p[0]-0.5, p[1]-0.5, 0)

viz.startLayer(viz.LINES)
viz.vertexColor(viz.GREEN)
for l1,l2 in LINES:
	viz.vertex(l1[0]-0.5, l1[1]-0.5, 0)
	viz.vertex(l2[0]-0.5, l2[1]-0.5, 0)

# Add points/lines to quad
viz.endLayer(parent=quad)
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Create an arc between two points hotshotiguana Vizard 5 03-22-2012 11:07 AM
black lines with render to texture Darkmax Vizard 5 03-07-2011 11:23 AM
Why I need two points for viz.startlayer(viz.POINTS) jincheker Vizard 1 01-28-2011 08:46 AM
Draw Line between Points Chrissy2009 Vizard 2 05-13-2009 04:42 AM
Track Eye Gaze with Lines enkeli Vizard 1 05-02-2006 02:06 PM


All times are GMT -7. The time now is 04:35 AM.


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