View Single Post
  #2  
Old 01-10-2014, 01:09 PM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
Quote:
Originally Posted by Notch View Post
I've tried using the following to manipulate the position of the polygon:

Code:
quad.setPosition(quad.getPosition() + [0, 10, 0])
In python, [x,y,z] + [a,b,c] actually gives you [x,y,z,a,b,c], so no wonder that doesn't work. The solution is actually much simpler. Since the quad is parented to the head, setPosition defaults to relative translation. In other words, you can simply say:
Code:
quad = viz.addTexQuad(parent=viz.HEAD, size=1)
quad.color(1,0,0)
quad.setPosition([0,0,10])
This places a red quad of 1x1 meter 10 meters in front of your view. Change size and position (and color/texture) as you see fit.
Reply With Quote