conceptual question on heightmaps + models

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
nevarim
Gnoll
Posts: 675
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
x 4
Contact:

conceptual question on heightmaps + models

Post by nevarim »

conceptual question:

I if I position a floor on a plot created by a heightmap, this I will be sunken in the ground since it is not the same plane.

you as you have settled the matter?

I thought of 2 ways:

by model (difficult) to create each model on the ground and not the other way
via code: make sure that the soil is suitable for automatic, but I do not think you can do this on heightmaps these being the result of a calculation on the basis of heights.


any suggestions?

thanks

Nevarim
i'm a noob until proven otherwise :D
used in my project ;) and thanks to everyone :D
Ogre 3d
Mygui
Skyx
Hydrax
MOC
CCS
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94
Contact:

Re: conceptual question on heightmaps + models

Post by tod »

- put models on flat surface.
- make model thicker so part of it can get into the ground and still look good (like a house model)
- flatten terrain before placing
User avatar
nevarim
Gnoll
Posts: 675
Joined: Mon Jul 05, 2010 6:16 pm
Location: Pavia Italy
x 4
Contact:

Re: conceptual question on heightmaps + models

Post by nevarim »

I too had thought about these answers,
analyzing them point by point:
- Put models on flat surface.
means I have to put everything on one sixth of the land and the effect is not the greatest, the world would be relatively empty.
- Make model thicker part of it I can get into the ground and still look good (like a house model)
makes the design of 3d models much more complicated and makes it unlikely the creation by the player of your own home at the point you wish to
- Flatten terrain before Placing
me this is the most difficult prer the programmer but also the most used in the world, this would mean me isntallare a concept of world modeling which falls into the dynamic modeling.


since the solution I'm using is the one applied in tutorial3, the use of heightmaps the only system would be:

find the midpoint of the mesh (eg a house but could also be something much more like a small rock) we recover the height of the point of intersection with a raylight.

so far so good

from here on, the problems arise:

on the ground aplico the height of all pixels that correspond to the rock doing so that they become a plan, then edit the area around the mesh so that it is softer than the difference of heights.

as in the attached image where the red line is the first and the black line is after

the problem is how to apply this solution on a heightmaps?
there is a tutorial or explanation of how it works dynamically changing the heightmaps?

thanks

Neva
Attachments
Untitled.png
Untitled.png (3.51 KiB) Viewed 467 times
i'm a noob until proven otherwise :D
used in my project ;) and thanks to everyone :D
Ogre 3d
Mygui
Skyx
Hydrax
MOC
CCS
User avatar
areay
Bugbear
Posts: 819
Joined: Wed May 05, 2010 4:59 am
Location: Auckland, NZ
x 69

Re: conceptual question on heightmaps + models

Post by areay »

If you don't want to modify your models to have a base then you could just make a separate model (or just an Ogre::SceneManager:PT_CUBE) and call it a 'foundation' or something.

When placing a building, first figure out the maximum height value inside the area that you'll be placing it. Create the foundation object and set it so that the top of the foundation is at the maximum height of the underlying terrain. Then place the house on top of the foundation.
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94
Contact:

Re: conceptual question on heightmaps + models

Post by tod »

Ogre terrain can be created by a heightmap, but once this is done, the heightmap is not used. The terrain is also editable, so you can flatten it at runtime. So don't focus on the heightmap, as it's only used in pre-production, not at runtime.
User avatar
Zonder
Ogre Magi
Posts: 1168
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 73

Re: conceptual question on heightmaps + models

Post by Zonder »

areay wrote:If you don't want to modify your models to have a base then you could just make a separate model (or just an Ogre::SceneManager:PT_CUBE) and call it a 'foundation' or something.

When placing a building, first figure out the maximum height value inside the area that you'll be placing it. Create the foundation object and set it so that the top of the foundation is at the maximum height of the underlying terrain. Then place the house on top of the foundation.
exactly what i was going to post. :D
There are 10 types of people in the world: Those who understand binary, and those who don't...
Post Reply