how to make a 3d world-edit?

Started by
2 comments, last by subi 17 years, 11 months ago
i want do make a sample terrain-edit, but i do not know how to do it anyone can give me a sample example? many thanks!
Advertisement
You mean like an editor that edits 3d terrain?

It depends on what you're asking. Just to be clear, I don't really know anything about this. Now, with that out of the way:

If you're talking about how to create the whole window and load terrain files, etc, etc, then you'll really have to go through these things step by step and learn how to do them:

  1. Set up a window in your API of choice (OpenGL, DirectX)

  2. Drawing (triangles, meshs, models)

  3. Loading terrain from a file

  4. Picking (clicking on the window and selecting the right object)


I know that's general and a bit short, but I got tired halfway through.

Anyway, to the terrain editing specifics: the way I see it is that you'll need a large mesh that consists of the vertices for the terrain.

Whenever the user clicks, you'll need to use picking to find which vertex was clicked on, or even enable the selection of more than one vertex, either through click-and-drag to create a 2d box on the screen and choose all the vertices inside the box, or you can go with the brush method. Basically the mouse cursor is a brush that has a specific effect (make the terrain higher, lower, etc) and a range, then the user uses the brush, all the terrain within the range of the brush (usually a radius with the mouse cursor position as the center point) has the brush's effect applied to it.

I hope this gave you at least a starting point. Sorry I couldn't be of more help, as I said before, I haven't actually done anything like this.

Good luck.
[size="2"][size=2]Mort, Duke of Sto Helit: NON TIMETIS MESSOR -- Don't Fear The Reaper
If you're loading your heightmap from a 2d bitmap, any graphical editor will do. If however you want to load your data as a mesh, you might as wel use 3dsmax or any other decent CAD program. You can edit terrain with that better than you ever could with your own coded tools.
I use 3dsmax for the terrain in my engine. It works by drawing the contours as lines and then applying a "terrain" modifier to it. Just try it, if ofcourse you've got MAX.

Jeroen
save yourself the trouble and buy a license for Freeworld3D. It's cheap as....www.freeworld3d.org

This topic is closed to new replies.

Advertisement