Please I nead help about using terrain data
by Afan Olovcic · in Torque Game Engine · 02/24/2007 (4:04 am) · 5 replies
Hi
I ma working on Terren grid system for Rts game. Idea is to make grid system for placeing buildings and player Ai on. http://www.garagegames.com/mg/forums/edit.post.php?qid=435032
What is the best way to take information about terrain verts position ,height and normals .
Thanks
I ma working on Terren grid system for Rts game. Idea is to make grid system for placeing buildings and player Ai on. http://www.garagegames.com/mg/forums/edit.post.php?qid=435032
What is the best way to take information about terrain verts position ,height and normals .
Thanks
About the author
www.bootwars.com
#2
I want to make grid system for Ai somethin like i RTS Games
,http://i11.photobucket.com/albums/a194/Alex_Huck/AIGriddemo.png
I currently parse the terrain at level-load time, on the server, to generate the node information.Each node will be on position on each vertex on terrain. All I nead is to make new class for example class node and take informations from terren vertexs x y , height and normal.but I am not shure from where to get thet informations.
terrData.cc i think but what is the best way to do thet and am I on god way.
Thanks
02/24/2007 (11:51 am)
C++ if it is posible but nevermind anything just to have direction I want to make grid system for Ai somethin like i RTS Games
,http://i11.photobucket.com/albums/a194/Alex_Huck/AIGriddemo.png
I currently parse the terrain at level-load time, on the server, to generate the node information.Each node will be on position on each vertex on terrain. All I nead is to make new class for example class node and take informations from terren vertexs x y , height and normal.but I am not shure from where to get thet informations.
terrData.cc i think but what is the best way to do thet and am I on god way.
Thanks
#4
03/11/2007 (3:14 am)
I'm trying to get the server to send terrain data over to the client to generate the terrain on-the-fly. Sounds simple in theory, as it would just be a heightmap (at first), but I'm sure it won't be that easy. So if that's what you're looking to do, at least know someone else it trying to do it as well.
#5
in the function you have to send the 2d postion (x,y) of point on terrain and function returns the height
F32 rtsNode::getTerrHeight(Point2F num)
{
Point2F pos;
F32 height = 0.0f;
pos=num;
TerrainBlock * terrain = dynamic_cast(Sim::findObject("Terrain"));
if(terrain)
if(terrain->isServerObject())
{
Point3F offset;
terrain->getTransform().getColumn(3, &offset);
pos -= Point2F(offset.x, offset.y);
terrain->getHeight(pos, &height);
}
return height;
}
just put this function in your class and use it
include terrData.h
03/12/2007 (3:03 am)
This is the function how you can take height from terrain in the function you have to send the 2d postion (x,y) of point on terrain and function returns the height
F32 rtsNode::getTerrHeight(Point2F num)
{
Point2F pos;
F32 height = 0.0f;
pos=num;
TerrainBlock * terrain = dynamic_cast
if(terrain)
if(terrain->isServerObject())
{
Point3F offset;
terrain->getTransform().getColumn(3, &offset);
pos -= Point2F(offset.x, offset.y);
terrain->getHeight(pos, &height);
}
return height;
}
just put this function in your class and use it
include terrData.h
Torque Owner Demolishun
DemolishunConsulting Rocks!
What context: player, vehicle, etc?