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
34
S
16
G
10
Posts: 285
Reputation: 7,349

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,170

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
34
S
16
G
10
Posts: 285
Reputation: 7,349

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
34
S
16
G
10
Posts: 285
Reputation: 7,349

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
386
S
229
G
87
Posts: 24,207
Reputation: 191,692

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 ImageImage
B
167
S
50
G
160
Posts: 8,170
Reputation: 103,436

Post » Fri Jun 05, 2009 9:38 am

Thanks :)
B
34
S
16
G
10
Posts: 285
Reputation: 7,349


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests