Drawing shapes on a 3d terrain

Is it possible to draw an outline on a 3d terrain using panda3d and then fill the outline with some color? If yes, can anyone please guide me to any useful tutorial or guide that i can read?

Panda3D is a game engine, not a drawing tool. You might be able to do this sort of a thing in Blender, I suppose.

David

drwr is basically right.
even thought panda is not a drawing tool . i still has some drawing capabilities which could be utilized to edit terrain.
have a look at pnmpainter and pnmbrush , it’s a little bit tricky to paint / edit terrain this way. but possible.
but as long as you dont need it in-game i also recommend blender or something simmilar

I’m a little surprised at these responses, using a tool like Blender isn’t an option if the outline is generated dynamically in code (if it’s not generated dynamically then by all means use an art tool to achieve the effect).

However, I think a bit more information is needed. Is the outline a general curve or a polygon (i.e., made of line segments)? Is the terrain something like a heightmap such that every XY coordinate maps to a single Z coordinate (height)? And how is the outline defined?

There is a discussion thread from a year or so ago that describes a method for painting on arbitrary model geometry which might be helpful in determining how to draw onto a texture using 3D world coordinates, and this could be combined with multitexturing to overlay a shape onto a terrain with arbitrary geometry. Doing a flood-fill within an outline would be an extra step but should be possible, or you could simply draw a filled polygon onto the overlay texture if that would work.

For a heightmap terrain a simpler method might be to just add an initially transparent texture onto your terrain, such that the terrain XY coords map to texture UV coords. Then you can modify the texture based on real world XY coords.

This is actually for a forest fire simulator. We get a polgyon (linked list of xy points) that gives us the fire perimeter. The current (2D) view draws that and then fills it with some color, but now we want a 3D view that can do that same in a 3D world. The Heightmap is actually generated by converting the given elevation data into a heightmap.

Could you please direct me to the thread that you are referring to?

One more thing, can this be used with a VC++ Project?

The post is at

discourse.panda3d.org/viewtopic.php … ight=paint

I found it just by doing a search for “paint”.

However, if I were you I’d look at doing the multitextured heightmap method., since you have both a heightmap and the precise coordinates of the fire perimeter. Render the perimeter to a texture, overlay on the terrain and you should be done.

Thank you very much!