MeshPainterScript

From K-3D

Revision as of 01:47, 4 June 2007 by Tshead (Talk | contribs)
Jump to: navigation, search

Template:Plugin/MeshPainterScript

Overview

MeshPainterScript can be used to do arbitrary rendering of a mesh under script control. For example, the following script renders mesh points as blue dots:

#python

from OpenGL.GL import *

glPushAttrib(GL_ALL_ATTRIB_BITS)
glDisable(GL_LIGHTING)
glPointSize(5)
glColor3d(0, 0, 1)

glBegin(GL_POINTS)
for point in Mesh.points():
	glVertex3d(point[0], point[1], point[2])
glEnd()

glPopAttrib()

Note that you must have OpenGL bindings installed for your script engine - Python in this case. On most platforms this is a separate download - check with your distribution on how to obtain PyOpenGL first, or visit http://pyopengl.sourceforge.net

Personal tools