draw verts in game real time

What I want to make is attached in the picture, purposely drawn in PaintBrush.

How do I do it? I want to use python. Because I don’t know any other way of doing a shiny green circle, with a line pulling up to the letters written in the square. And they should be always facing the camera. Which would be a pain to do without using Blender Geometry. That’s what I believe… any other opinion is appreciated.

Thanks

Attachments


You should be able to draw the circle, handle, and box with alpha in a 2D image program. Then you can map that onto a plane with alpha enabled. You can put a text plane (Scroll down to Text) in the box. Use the track to actuator on the plane so it always faces the camera. Just be sure the center of the plane is in the center of the circle. Also, parent the text to the plane.

Halfway through this I figured it made no sense, so here’s a blend. Change the property on the Text plane in the second layer to change what it says.

Attachments

circle.blend (262 KB)

Yeah. You could do that and even scale to match the dimensions of the object you are selecting. (Using Python)

Another way is to use wire frame meshes to build the lines.


With that you always get a one pixel line. Be carefull, it is still a 3d object and can be hidden by other objects.

Attachments

WireCircle.blend (144 KB)

Is there any other way besides doing in 2D? Using Blender.Geometry

Not that I know of. The Blender module isn’t implemented in the Game Engine.

Moguri actually worked on a nice batch of drawing functions for 2.5 months ago, his GSoC project he is working on now includes geometry shaders so you’ll be able to create geometry dynamically using a shader (only found in his branch at the moment, will probably be in trunk in a few months)

Here is a blend example I made: Selector.blend (175 KB)

The selector circle starts with 1.0 dimensions. That way it is easy to scale to any diameter.
The script simply gets the dimensions of the object selected, then scales the selector to that value (*1.5 for proper wrap around).

-Sunjay03

Well that’s a nice way to do it, though I wanted to make geometry lines like I showed in the attached image through python code, like the same way you draw lines in java…

Not until 2.5 I guess…

I was just showing a way to fake it.

-Sunjay03

oh… that’s really bad… but thanks for the help

Why is it bad?

It works fine.

If you wanted a one pixel circle, all you have to do is delete the inside vertices of the circle.

-Sunjay03