Rasterizer.drawLine() + viewports

def drawLine(from,to,color):
“”"
Draw a line in the 3D scene.

@param from: the origin of the line
@type from: list [x, y, z]
@param to: the end of the line
@type to: list [x, y, z]
@param color: the color of the line
@type color: list [r, g, b]
"""

This is all I can find on the new feature with revision 16716. It’s part of the Rasterizer.py file in the gameengine’s PyDoc folder.

It works great. Here is a simple, but pretty demonstration of it that I threw together:
http://userpages.umbc.edu/~smyth1/blender/spin-thing.blend It should work with pretty much any build in the last month.

My only issue with it is when using viewports. Apparently it doesn’t recognize viewports, it only recognizes the active camera and doesn’t recognize that the active camera (when using viewports) is offset, and renders over the other cameras’ viewports.

Has anyone else run in to this and found a way to work around it?

Edit: Hmm, it seems to work when I modify the file I posted. But it doesn’t seem to work on my main project. It’s odd.

very nice, 3d draw!? thats incredible! that will be a great adition for my projects!

btw, wut do u mean by viewports? like each different camera?

ugh! was just looking for something like this. wohoooo! thanks for pointing this out, there’s plenty of new undocumendted features, and I’m just making a project where it will help me greatly…

btw. can u set up the thickness of the line?

I get a console error on the first line “import Rasterizer”

atom reinstall python, and if u dont hav python 2.5 installed then install it.

Can this be used in the GE? Because this is something I’ve been hanging out for for a while.

lipsonfire: http://www.tutorialsforblender3d.com/Game_Engine/Viewports/Viewport_1.html

andrew-101: It is in the GE now. 2.48 will have this feature.