Results 1 to 4 of 4

Math Help - isometric game area problem

  1. #1
    Newbie
    Joined
    Dec 2012
    From
    Manchestoh
    Posts
    2

    isometric game area problem

    helloooo. i am totally new here and not strictly from strong maths background so bear with me.

    im trying to make an isometric videogame, and there comes a point where i need to determine which of the game floor tiles the mouse is hovering over fomr the mouse x,y.

    the problem is i need to determine the top left x,y value of a sprite when the mouse is over it, but only within the actual tile shape itself not the mask area of the sprite.

    the dimensions are thus:
    sprite height 32 pixels, width 64 pixels, the pixels numbers start at 0 rather than 1 from the top left of the sprite, and the actual shape of the tile is a diamond pointed at the middle two pixels of each horizontal and vertical face.

    please can someone point me in the right direction, my brain hurts
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,612
    Thanks
    591

    Re: isometric game area problem

    Hey Hexidecimentalist.

    What shape is your mask? Is it a rectangle or a general shape?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2012
    From
    Manchestoh
    Posts
    2

    Re: isometric game area problem

    Hi chiro, thanks.Sorry it took me so long to respond, the festive season leaves me little time for geek fun .

    the mask is a general shape, but the shape itself is constant between tile sprites. heres the sprite and the mask,

    isometric game area problem-basictile.gif isometric game area problem-basictilemask.gif

    and the sprite again pixel by pixel

    isometric game area problem-basictilegrid.gif


    so, with the shape being constant, surely it is possible to return the top left x,y coords of the sprite from x,y coords taken from inside the polygon?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,612
    Thanks
    591

    Re: isometric game area problem

    Have you tried applying bit-wise AND masks and then checked what the value of the first non-zero bit is under some constraints?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. isometric definition
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: May 6th 2012, 12:38 PM
  2. isometric drawing
    Posted in the Geometry Forum
    Replies: 3
    Last Post: April 8th 2012, 09:36 AM
  3. Isometric
    Posted in the Differential Geometry Forum
    Replies: 4
    Last Post: May 24th 2011, 12:23 AM
  4. Isometric?
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: October 10th 2010, 11:26 AM
  5. Isometric imbedding
    Posted in the Differential Geometry Forum
    Replies: 3
    Last Post: November 18th 2009, 01:18 AM

Search Tags


/mathhelpforum @mathhelpforum