Depth sorting - almost solved

For questions about using Classic.

Post » Sun Jan 17, 2010 1:58 am

hey that's pretty good, I gotta find out how you did those slopes too
What exactly are you doing in terms of sorting? I didn't quite understand entirely, hopefully what you did will work on my one. I'm about to try another method right now actually, just as an idea I had, probably won't work like all the other ideas lol
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sun Jan 17, 2010 5:17 pm

i knew measuring camera distance was the way to go., are you calculating the distance to a 45 degree plane from the top edge? or to a point from the top edge? it seems the plane would work just fine, seeing as a 2.5d projection has no perspective, and therefore the view "frustum" would just be a box, if you know what i mean. it might solve some problems doing things this way.

if you were doing this in iso, would you just sort from the closest corner, (bottom of top face) to the camera?
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sun Jan 17, 2010 8:57 pm

I don't think my approach can work on yours, as I'm not using the physics plugin... i could be wrong though, if you're doing collision on your own maybe it could.

Anyway, slopes are two factors (dwdx, dwdy) and you may obtain the real height at any point by measuring the distance to the hotspot and multiplying by the appropiate factor, which will give you a dw that you can add to the height.

About sorting, yes: 45 measured to the scene origin, sorting inverted (seeing as the "camera" doesn't really have a position in 3D space). I also thought bottom of top face would be the way to go but, strangely, bottom of bottom face yielded the best results O_o so I'm using that now.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Jan 18, 2010 12:23 am

As I'm not quite that good at maths, I'm not sure how to calculate the distance in the way you mentioned... :(
Do you think you could enlighten me a little? :D It should still work fine as the sorting and physics movement are completely separate really, although the angle I'd be using is 35.264
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Mon Jan 18, 2010 7:31 am

say that top is the measured top of the platform at a certain rx, ry position, where w is the distance from the base to the floor and h is the height of the 3D object.

top = w+h+((platform.rx - measure.rx)*dwdx)+((platform.ry - measure.ry)*dwdy)

hope that clears it up somewhat =)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Mon Jan 18, 2010 7:52 am

Is that for slopes? It looks like slopes to me. Thanks a lot for the explanation though, I probably really need it. I'm sorry though, I meant could you explain the expression you used for your sorting, I tried doing it myself but I don't think i understood entirely what you were doing.
Are you comparing it to like a 'plane' where the camera is or are you comparing it to 0 on the Y axis?
When you said point of origin, what does that refer to? Sorry I'm so dense, I suck at maths lol

I would really love to know how to fix this sorting problem. thanks heaps
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Mon Jan 18, 2010 8:22 pm

yeah that was for slopes.

For sorting I'm doing for each object, ordered by (object.bottom^2)+((object.3dheight+object.tallness)^2) send to back.

so far it's working nicely but you can't have flat objects that are also deep.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Jan 19, 2010 2:04 am

Thanks heaps for filling me in, however it's not working properly :S
Is it ascending or descending? Neither really work for me lol

when you say 3dheight and tallness, is the 3dheight how far it 'bottom side' is off the ground or how far the 'top side' of the object is from the ground? I'm assuming tallness means bottom edge to top edge.
I'm using nothing but cube shaped objects at the moment and it really isn't looking good lol
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue Jan 19, 2010 3:33 am

yeah my objects have height, width and depth
we're probably taking different approaches :P
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Jan 19, 2010 5:06 am

Mine have height and width, just not depth..... would that really affect the sorting though?
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests