Help with mouse position

Started by
3 comments, last by NiDoRaN 22 years, 12 months ago
I am so said because i have already spend 4 days on my mouse position detection blah blah how ya can call it Maybe someone can help me I want to get a box image of 64x32 over a piece of ground it is isometric /\/\/\ \/\/\/ /\/\/\ \/\/\/ but i dono how to do this because of my mouse x and y cord''s i can''t get any sense out of it. only what it has to calculate the x and the y cord. if it is in the section. maybe this is alittle bit hard to understand but i dono how to explain it hope ya guys can help me
Advertisement
Assuming my web server is working, go here:

http://eberwein.dyndns.org/fantasyfootball/iso/mousetoiso.htm

This is a little tutorial that I''ve written.

Grimbo
I do mouse routines like this:

  int SelectedTileX,SelectedTileY;POINT MPOS;GetCursorPos(&MPOS)SelectedTileX = MPOS.x/64;SelectedTileY = MPOS.y/32;  


This worked because SelectedTileX & Y are integers.

/MindWipe



"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."
"To some its a six-pack, to me it's a support group."
In Isometric game programming with directX7.0
Page 325
There are a good way to do it!
Here is some advice....
Well if your tile sizes are static and don't vary or change you can use the methods mentioned above but if you want to be able to support multiple sized tiles and dynamic changes on tile sizes you could use the polygon based method...

Create array of tiles and their positions when mouse is pressed at some point of the map and after that go through the tiles using some PointInPoly algo... This is very fast when you just generate the array for tiles currently visible... This makes future changes example changing from 2d to 3d isometric engine easy.

Edited by - Pexi on April 26, 2001 2:55:19 AM
Pekka Heikurapekka.heikura@mbnet.fi

This topic is closed to new replies.

Advertisement