Generate 2D map from 3D scene

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
metalseb
Posts: 15
Joined: Tue Mar 01, 2005 8:50 am
Location: Lille - France
Contact:

Generate 2D map from 3D scene

Post by metalseb »

Hi there

I am currently trying to implement an A* pathfinding algorithm for a given node in a given scene. But to achieve this, I need to have the top-down 2D view of the 3D scene I am currently rendering on the screen, and I don't have any idea on how to do this. Anybody could help ?

Regards
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Check out mohaps' site as he's going to release the source of his "radar". Check the Project Announcements part of this forum for the thread about it.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Guest

Post by Guest »

Hi,

I have very similar problem, but I am only interested is showing a map from the top. Mahaps "radar" is showing the nodes (I've seen only screenshots), but .bsp map is a node.
So my question is how to show geometry (walls) of the .bsp map.
Is it possible ? How professional game-makers create HUD maps?
Guest

Post by Guest »

have a look at the split screen tutorial. Then for the top down
view change it to orthogonal mode.You could also change it to
wireframe for use in an editor etc.

http://legion.gibbering.net/mankind/ortho.jpg
Guest

Post by Guest »

thanks

orthogonal view is the word I was looking for. Interesting is that it seems not to render the roof of my map. Strange for me and very useful.

Wireframe mode is not the best solution because it shows every edge. Many triangles == many / lines.

To have only borders of walls I suppose I have to create special map in photoshop. Than put it in hud and over it set the user marker.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

I guess that's the way they do it in real games. Just a 2D map drawn in a image editing program (then they use mohap's way to put arrows on it). Or you could indeed use splitscreen although this will cost you some performance (twice rendering the same scene, just from a different point of view).
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
mohaps
Posts: 248
Joined: Tue Jun 08, 2004 1:54 pm
Location: Shrewsbury MA
Contact:

Post by mohaps »

hi the code actually is quite simple

Code: Select all


class Object
{
   vector3df positionAbsolute;
   u32 type;
}
...
array<Object*> objects;

ISceneNode* centerNode; //this is the node representing the center of the projection
vector3df centerPosition = centerNode->getAbsolutePosition();

matrix4 m = centerNode->getAbsoluteTransformation();
for(int i = 0; i < objects.size(); i++)
{
   vector3df relPos = objects[i]->getAbsolutePosition() - centerNode->getAbsolutePosition();
   m.rotateVector(relPos);

   //now relPos.X and relPos.Z contain the 2D Mapped coordinates of the object


}
   


---
Saurav Mohapatra
author, artist and bona fide geek

web: http://www.mohaps.com
email: mohaps AT gmail DOT com
Post Reply