to the man: Anonymous Poster
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
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"
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"
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.
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!
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement