Z Order in angle

For questions about using Classic.

Post » Thu Jun 04, 2009 9:12 am

I now how to render objects with top-down z ordering, but I want to render in 45 direction. Any idea?

B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Thu Jun 04, 2009 9:30 am

Compare their positions with offset at 45 degrees, I believe. Just like you compare Z levels, you can compare on diagonals.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Jun 04, 2009 11:59 am

I think that I found the answer:

Z order = ( X + Y ) / 2

Is this correct (so simple)?
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Thu Jun 04, 2009 12:27 pm

I'm not entirely sure what you mean but if it's for a game with the same perspective like diablo but with NO third axis of movement (jumping) i find something like this usually works
For each (object that needs to be sorted, best to use a family) ordered by Familynamehere.Y - ascending
- send to front

Hope that's understandable :)
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Thu Jun 04, 2009 12:47 pm

Yes, I understandable this :wink: . But In my case I am doing it turning the layer 45 degrees. So Y based z ordering doest work.
B
30
S
15
G
10
Posts: 285
Reputation: 7,144

Post » Thu Jun 04, 2009 2:04 pm

[quote="Aritz":14kztpjy]I think that I found the answer:

Z order = ( X + Y ) / 2

Is this correct (so simple)?[/quote:14kztpjy]

I think that's right for specifically 45 degrees. There'd be some trig for other angles, but especially for 45 degrees, that should work :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Thu Jun 04, 2009 8:21 pm

Oh wow, yeah I guess when you think about it, the angle between x, and y will always be 90. :D
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Jun 05, 2009 9:38 am

Thanks :)
B
30
S
15
G
10
Posts: 285
Reputation: 7,144


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests