Path on the ground plane

(KingJames) #1

Setup: I have an object that is “flying” above a plane by reading real data (positions x,y,z) from an array in the real time engine.

What I need: Using the X, Y coordinates (which I have already in an array), I want to in some way, to draw a path on the ground (or plane) of the projection of the object flying above the plane.

One solution: Create a low poly object. Dynamically duplicate it at every x, y interval and give it that x,y interval position to create somewhat of a “dashed” path on the ground plane.

Does anyone have a more clever solution? If not, is it possible to duplicate objects while running the real time engine?


(d0pamine) #2

Yes, you can duplicate objects with the Edit Object actuator, set to “Add Object”.

Another option could be to use the python mesh access to “stretch” a mesh dynamically over the ground. You could make a long plane subdivided into as many “sections” as the length of your list of positions. Start out with all of the vertices in one position and then set vertex positions at each frame. The only problem is that your mesh will have a section of it leading from the latest path position to all the upcoming vertices that are still sitting at the first position. Mabe this is only a problem when looking at the path marker from certain angles or if you use a transparent texture?


(KingJames) #3

hmmm…is there a way to add verticies in the RTE? I could start with a plane, move it to the first x,y coordinate, then after that, add two verticies to two existing verticies, and move the new ones to the next x,y position, and repeat the process until the flight is over. The problem with having a plane with many verticies initially is that the number of x,y points is dynamic and may change with different data (flights).

(d0pamine) #4

no you can’t add vertices, but you could either (a) make the path marker with the maximum number of vertices you could possibly need, or (b) you could use the “add object” actuator when you run out of vertices.