6 Replies - 2419 Views - Last Post: 04 June 2009 - 06:00 AM Rate Topic: -----

#1 Xioshin  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 264
  • Joined: 05-November 08

Turning 2d array into Isometric?

Posted 03 June 2009 - 10:00 PM

Hi guys,

I have a 2d array that I'd like to try making isometric (even if just on a test php page to see how it looks).

How exactly do I have to do it?

I thought if I could just take each image that gets displayed during the output of the 2d array and change it from a square to a diamond, that I could get the first step of an isometric array working. This is not true isometric, but more of an illusion.

I then realized that the array would be printed like in example 2.

How can I achieve example 3?



Posted Image

Is This A Good Question/Topic? 0
  • +

Replies To: Turning 2d array into Isometric?

#2 bsaunders  Icon User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Turning 2d array into Isometric?

Posted 04 June 2009 - 02:50 AM

Is the image composed of tiles?
Was This Post Helpful? 0
  • +
  • -

#3 Xioshin  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 264
  • Joined: 05-November 08

Re: Turning 2d array into Isometric?

Posted 04 June 2009 - 04:28 AM

Can be..The html displayed being generated by the PHP code can be changed to anything I want - but I'm looking for a desired effect.

In this case, yes just pretend each image being displayed by the 2d array is a perfect square "tile".

View Postbsaunders, on 4 Jun, 2009 - 01:50 AM, said:

Is the image composed of tiles?

Was This Post Helpful? 0
  • +
  • -

#4 bsaunders  Icon User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Turning 2d array into Isometric?

Posted 04 June 2009 - 04:49 AM

What about an image composed of diamonds that have no 90 degree angles?

Posted Image
Was This Post Helpful? 0
  • +
  • -

#5 Xioshin  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 264
  • Joined: 05-November 08

Re: Turning 2d array into Isometric?

Posted 04 June 2009 - 04:53 AM

I admit that my images were not great because I did them so quickly in Paint, but I'm pretty sure even with your graphic, printing a 2d array with this image will look like example 2 in my image on my first post.

Gray being the tile, white being the gap left between

View Postbsaunders, on 4 Jun, 2009 - 03:49 AM, said:

What about an image composed of diamonds that have no 90 degree angles?

Posted Image

Was This Post Helpful? 0
  • +
  • -

#6 bsaunders  Icon User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Turning 2d array into Isometric?

Posted 04 June 2009 - 05:02 AM

Oh, I understand now. I think I know of way of solving that problem. But, first, what code are you using to render the "tiles" as they are now?
Was This Post Helpful? 0
  • +
  • -

#7 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,000
  • Joined: 08-August 08

Re: Turning 2d array into Isometric?

Posted 04 June 2009 - 06:00 AM

To get from figure 1 to figure 3, you need to rotate by 45. You could do that by converting each point in the array to polar coordinates, adding 45 degrees to its angle, then converting back to cartesian coordinates.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1