Archived

This topic is now archived and is closed to further replies.

MasterInsan0

How to do click-and walk in an Iso 3D RPG

Recommended Posts

MasterInsan0    122
Much like in Neverwinter Nights, we want to be able to click on an area in the 3D world and have the active character walk there (or all of them). But I cannot find and/or think of how this could be done! Does anyone have a good idea? (please excuse me if I sound like a newbie as this is my first MAJOR project, the rest were just to sharpen my skills like a Bricks game) Thanks. ----------------------------- "C++ isn''''t hard, you fool!" Famous Last Words -----------------------------

Share this post


Link to post
Share on other sites
MasterInsan0    122
No, no, not the actual pathfinding, I mean...ok, I''ll simplify the question a little...

How would I go about clicking on the 3D Terrain? Like, if the character clicked on the tree it would say "You clicked on the tree!" I could implement the everything else, I just can''t think of how the cursor could interact with the 3D world. I know it''s probably very simple, but I just can''t figure it out!

-----------------------------
"C++ isn''''t hard, you fool!"
Famous Last Words
-----------------------------

Share this post


Link to post
Share on other sites
THE Omega    122
So you''re saying "how can I get the computer to recongnize where I''m clicking?" right?

In OpenGL, this is handled by the selection buffer. Don''t ask me about DirectX. And don''t ask me about OpenGL either because I haven''t quite learned about it yet.

Maybe someone else with some more knowledge can help with this one

Share this post


Link to post
Share on other sites
kmsixpence    134
for the provious post, that wouldn''t work on a 3d terrain. You could either do one kind of testing, or the other. The first is you just test what height it is and what width it is and compare it to the tiles but in 3d. Its hard to explain and tanstaafl talks a little about it in the last chapter.

The other way would be to do ray tracing. If your using dx, look at the picking sample. For ogl, sorry, don''t know.

Share this post


Link to post
Share on other sites
GBGames    217
I believe I was reading something about it either in The Red Book or in OpenGL Game Programming. Check out those books which might have something on it. Most likely the second one. I haven''t read too much in it so I don''t know.

Share this post


Link to post
Share on other sites
miataman1990    122
Well, this is just a thought...but if you are working in 3D the curser could be a 3d object. Then when the user clicks the mouse you could cach the xyz of the curser object. It sounds logical...I think

Share this post


Link to post
Share on other sites
GBGames    217
Actually the cursor is 2D, unless you do something like Black & White, where the cursor has depth on the screen.
Think of Homeworld: Cataclysm where the cursor is just like it is in Starcraft. The question is how does it know where in 3D space it is clicking?

Share this post


Link to post
Share on other sites
Dredge-Master    175
as stated above a few times, you can use picking (someone said directX has it, and I know for sure that OpenGL does) or the converting to map co-ordinates.

If it is a true ISO engine, then you can just convert the mouse axis to screen coordinates.

In a perspective engine, you can stil convert it (much harder though) or you can just use picking. I recommend picking personnally. Works well (although it uses an extra frame, atleast under OpenGL)



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites
MButchers    123
Hello there,

if your using OpenGL you can use gluUnProject
with screen X,Y and the value of the Z buffer,
which can be obtained by using glReadPixels
with the format of GL_DEPTH_COMPONENT.

Hope it helps

Mark.

Share this post


Link to post
Share on other sites