Making objects defined in the mission file sit on the gound
by Alice O · in General Discussion · 10/19/2004 (5:14 pm) · 3 replies
I am drawing hundreds of trees on the terrain, based on X,Y,Z coordinates from a GIS. The Z coordinates are slightly off (some of my trees float or are submerged below the terrain) as there is a minor discrepancy between my DEM values and the smoothed version of the PNG in Torque. Is there a way I can just provide the X and Y coordinates and make the Z be that of the terrain in the specific location... a kind of defualt, 'sit on the ground' value? I know there is a ConformToGround command that can be used for the player, but I'm not quite sure where to start to get this working for the trees...
#2
Open the mission editor (F11)
Select all of the objects
In the menu choose World->Drop to Ground (it is at the bottom)
Then choose World->Drop Selection
It is important to note that the base/origin of the object needs to be at zero z in its local frame of reference. In other words for dts's the bounding box's pivot needs to be at the "feet" of the model and for interiors you need to build it so that the base of the model lines up with the axis in the side/front views.
You can accomplish the same thing programmically by using getTerrainHeight() and setTransform().
01/29/2005 (7:41 am)
Load your missionOpen the mission editor (F11)
Select all of the objects
In the menu choose World->Drop to Ground (it is at the bottom)
Then choose World->Drop Selection
It is important to note that the base/origin of the object needs to be at zero z in its local frame of reference. In other words for dts's the bounding box's pivot needs to be at the "feet" of the model and for interiors you need to build it so that the base of the model lines up with the axis in the side/front views.
You can accomplish the same thing programmically by using getTerrainHeight() and setTransform().
#3
01/30/2005 (3:06 pm)
Thankyou very much Matthew!
Torque Owner Alice O