Archived

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

ruellm

to the man: Anonymous Poster

Recommended Posts

ruellm    122
hey, can i ask for some sample SOURCE code on how to make SELECTION on 3d RTS? even a simple one, an object place on a terrain will do... thanks ruel

Share this post


Link to post
Share on other sites
PhiberOptic    128
I don''t really get your question, but I think you mean how to select one/many units in 3d with the mouse?!

However, that is very easy to achive..

let the mouse create a 2d box aligned with X-Z plane. Check if the object are inside that box and skip the Y coord.

if ( obj.x < box.max.x AND obj.x > box.min.x )
if ( obj.y < box.max.y AND obj.y > box.min.y )
obj.selected = true;

or something like that.. :-)

I hope I didn''t missunderstand you!

----------------------------------------------
Petter Nordlander

"There are only 10 kinds of people in the world. The who understand binary and those who don''t"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
ok I''ll send you my whole project. If you can get selecting the terrain to work (as far as I know my way should work, it just doesn''t) please send me a copy back.

Share this post


Link to post
Share on other sites
Odd the Hermit    122
quote:
Original post by Stonicus
How do you even begin to write an RTS if you can''t figure out how to select a unit with the mouse? C''mon people!




Or if you think that "Anonymous Poster" is a single, unique individual...

-Odd the Hermit

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I have only posted a couple of times in the last year or so. I could login, in fact I did in the DirectX forum as Glak. I just don''t choose to usually.

Share this post


Link to post
Share on other sites