klampt.vis.gldraw module

OpenGL drawing functions for geometric primitives.

klampt.vis.gldraw.point(p)[source]

Draws a point at position p (either a 2d or 3d list/tuple)

klampt.vis.gldraw.circle(center, radius, res=0.01, filled=True)[source]

Draws a 2D circle with the given center, radius, and angular resolution. If filled=true, it is drawn filled, otherwise, it is drawn as a wireframe.

klampt.vis.gldraw.triangle(a, b, c, lighting=True, filled=True)[source]

Draws a 3D triangle with points a,b,c. If lighting is true, computes a GL normal vector dynamically. If filled=true, it is drawn filled, otherwise, it is drawn as a wireframe.

klampt.vis.gldraw.quad(a, b, c, d, lighting=True, filled=True)[source]

Draws a 3D quad with points a,b,c,d. If lighting is true, computes a GL normal vector dynamically. If filled=true, it is drawn filled, otherwise, it is drawn as a wireframe.

klampt.vis.gldraw.box(a=(0, 0, 0), b=(1, 1, 1), lighting=True, filled=True)[source]

Draws a 3D axis-aligned bounding box with lower corner a and upper corner b. If lighting is true, sends gl normal vectors. If filled = True, draws it solidly. Otherwise, only the wireframe is drawn.

klampt.vis.gldraw.centered_box(dims=(1, 1, 1), lighting=True, filled=True)[source]

Draws a box centered around the origin with the given width x height x depth

klampt.vis.gldraw.setcolor(r, g, b, a=1.0, lighting=True)[source]

Sets the current color/material, depending on the lighting flag

klampt.vis.gldraw.xform_widget(T, length, width, lighting=True, fancy=False)[source]

Draws an axis-aligned transform widget for the se3 transform T. Length / width govern the length / width of the axes. If fancy=True, draws the axes with real volume rather than lines

klampt.vis.gldraw.hermite_curve(x1, v1, x2, v2, res=0.01, textured=False)[source]

Draws a 3D Hermite curve with control points x1,v1,x2,v2 and resolution res. If textured=True, generate texture coordinates for each point (useful for applying patterns).

klampt.vis.gldraw.bezier_curve(x1, x2, x3, x4, res=0.01, textured=False)[source]

Draws a 3D Bezier curve with control points x1,x2,x3,x4 and resolution res. If textured=True, generate texture coordinates for each point (useful for applying patterns).

klampt.vis.gldraw.glutBitmapString(font, string)[source]

Renders a string using GLUT characters