JakeWharton / scalpel

A surgical debugging tool to uncover the layers under your app.
Apache License 2.0
2.77k stars 232 forks source link

3D is wonky and needs redone. #3

Open JakeWharton opened 10 years ago

JakeWharton commented 10 years ago

The 3D implementation is fairly wonky as a result from being iterated on rapidly rather than thought out initially. On the rotation extremes, you can clearly see that the layers are being translated along the rotated x/y axes to perceive z-axis movement. While this creates visual separation that looks like spacing, it makes the layer's appear smaller. We need true 3D manipulation where the layers are rotated with the model and moved along the true z-axis.

Note: It's important that the model be perfectly flat when viewed from straight on. Otherwise, the z-axis spacing would cause perceived sizes to be wrong. That is, a control that's a few levels up would appear much larger than if it were on the "ground" layer. This is honored now by scaling the x/y translation by the rotation percentage. For example, a 30 degree rotation is 50% of the max therefore we only separate the layers by 50% of their spacing.

christopherperry commented 10 years ago

Why don't you use an Orthographic Projection to get rid of the scaling effect and just put your layers on different points of the z-axis?

I don't see any OpenGl classes in your implementation. It would probably be much easier (and less code) if you went with OpenGl. This is actually something I would donate time to help you with.

JakeWharton commented 8 years ago

Can steal code from https://github.com/danielzeller/Depth-LIB-Android-