An idea for mouse clicks in a 3D iso world
Basically, my idea for finding the where the mouse clicks in a 3d world is like the same as in a first person shooter in calculating where the bullets are going. So what you can do is calculate a vector from the viewer through the mouse position and then calculate what tile that vector intercepts.
Here is a diagram of kind of what I mean
These are the tiles
[]
[][]
[][][]<----mouse----eye
[][]
[]
i kind of think of my mouse pointer as floating in the space between the viewer and the world, so you can then calculate a vector from the viewer location through the mouse and extend that vector onward until it contacts a tile, and then that tile is the tile the mouse pointer is over.
Now i havent actually implement it yet but I know it will work just like the bullet trajectories in a fps game work.
I hope this help some people and let me know if any of you get it implemented.
Possibility
I tried this implementation a number of times last week. It''s not completely accurate if your world-view (ie, map) isn''t set up with an orthogonal view. If you just take an everyday fps shooter, but position the camera some distance from the x-z plane and tilt at some angle downward, you will experience some inaccuracy the further you click away from directly mid-screen.
To be clear (if I can.. heh), let''s say your screen rez is 640 x 480. and you''re looking down at the map at a 15 degree angle. Your projections from where you click on the screen will decrease in accuracy as you move away from the middle: (320, 240). This is due to the fact that when calculating the projection to world space, you''ll deal with the tangent of 75 degrees (90-15). The range of tangent is [-infinity, +infinity], and you''ll find you character moving off into the horizon.
Anyway, here''s a series of post that saved me a bit of time on this subject:
http://www.gamedev.net/community/forums/Topic.asp?topic_id=23114&forum_id=13&Topic_Title=&forum_title=Isometric+Land
I''m moving off in another direction, methinks!
-aw
---
"We are Indigenous. Welcome."
To be clear (if I can.. heh), let''s say your screen rez is 640 x 480. and you''re looking down at the map at a 15 degree angle. Your projections from where you click on the screen will decrease in accuracy as you move away from the middle: (320, 240). This is due to the fact that when calculating the projection to world space, you''ll deal with the tangent of 75 degrees (90-15). The range of tangent is [-infinity, +infinity], and you''ll find you character moving off into the horizon.
Anyway, here''s a series of post that saved me a bit of time on this subject:
http://www.gamedev.net/community/forums/Topic.asp?topic_id=23114&forum_id=13&Topic_Title=&forum_title=Isometric+Land
I''m moving off in another direction, methinks!
-aw
---
"We are Indigenous. Welcome."
---"We are Indigenous. Welcome."Indigenous Technologies, Inc.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement