I read that this was not possible back in 2005 (searched first of course), but now with such substantial additions to the GE, has this been considered? I’m thinking of ways to animate a wire simulation without having to manipulate a mesh.
I guess if I did have all the points on the wire, I could position static cylinders between them, but that would require me to create all the needed cylinders before running the GE, correct? I’m looking for some kind of dynamic drawing if you get my point?
I’m thinking of ways to animate a wire simulation without having to manipulate a mesh
you can use blender materials through the game menu and enable materials there then you go to the cube let’s say and from it’s materials you enable the wire mode .
Draw Line in Game Engine with Python ?
i remember that you can draw an overscreen overlaied rectangle and those basic shapes with py game too long before , but didn’t try it … so you can make old styled green overlay like in TVs
guess if I did have all the points on the wire, I could position static cylinders between them
do you want them pipes or lines , i mean do you want them 3d ?
I’m looking for some kind of dynamic drawing if you get my point?
yes the enable wire mode will be changing for each frame , not only for one frame
sorry if i didn’t understand your question and didn’t answer it
The Blender Game engine dose not support 2d blit-ing of lines, pixels or text like other game engines.
To make a straight line, use a small plane, place the object center on the -y side of the plane, and scale it.
If you want to do this dynamicaly, scale the line to its biggest possible length on its +Y axis (s,y) , and snap a quick IPO keyframe by pressing I. go forward 101 frames, and scale it to nothing, and snap a second IPO keyframe.
Add a IPO brick to play the IPO animation, set to property…
Now make a property that the IPO brick will monitor… This is the property you will manipulate for the line length.
You might want to do the animation I mentioned in reverse, so that the biggest is 100, and 0 is nothing… might make it easier for comprehension later (100 is the line’s 100% and 0 is the line at 0%)
Not the greatest method in the world, but you can do what I mentioned without any python code.
when you add it to a scene, it will inherit the rotation of the object you add it from. Then just poke in the IPO for the length , and you will be all set
If you turn the plane on edge, so that the plane is verticle on the Z axis, and use a material with wireframe… and set your camera to orthoscopic mode facing the -z axis, you will always draw lines that are exactly 1 pixel across.
Actually, I will be showing other geometry with textures and transparency, the wire need only to be black and the drawing needs to be done in 3d (since those are the coordinates I’m going to calculate). Basically, I want a long chain of hinge constraints with something inbetween them (such as cylinders of just a plain black line). Best would be a line, since that would be much less to compute. Imagine a x-ray image of the cardiac arteries… or se images below.
In the above image, the wire is clearly visible, that’s what I want to drawLine() with.
The wire would be calculated as a bezier curve from the collision points as below:
(blue are hinge constraints, green are handles and red is computed curve (drawLine())
So, any ideas? Again, the camera will not be ortographic and there will be other geometry, so I’m thinking (worst case) I’ll have to pre-create a bunch of constraints and getLocation each frame, then place cylinders or textured planes in-between these points. This leads me to a new question: Is it possible to create NEW vertices within the GE, or do I have to pre-create these as well?
swebal,
GE doesn’t support adding manually (programaticaly) constructed 3d objects, lines or meshes. You have to prepare mesh, show it and update its vertices. Look at this video - graph is created from prepared mesh, but it shows randomly generated values.
.
Another option is to make your drawing in 2d image and then load it as texture to some bilboard.
Oh well, I didnt read the tut, just grabbed the url for later use, when/if need be.
Hmm, I read it again and am more confused. But couldnt you just use 1 unit planes, with the line/curve or cylinders. Then use a grid of empties and place the correct plane at the empty when needed?
the curve can be rotated to any direction you need, and using alpha planes means it could look more like your picture.