So my question is: what determines the scale that the image would have to be in when pushed back into the z dimension? Is there some formula I could use? Would trigonometry be involved?
Honestly man, this is a subject worth it's own forum, I'm not sure I can be of much help.
When you introduce that 3rd dimension, you complicate things exponentially.
In a 2D space you have 2 transformations:
1) Scaling
2) Translation
When you add the Z dimension you need to calculate rotation.
To accomplish the effect you are after in PHP would be madness -- unless there was some extension library similar to GD which performed the calculations for you. 3D processing is a slow process, even in the best of environments.
Consider the likely steps required if you chose to move forward:
1) Calculate the 3D points for a rectangle, taking into consideration (translation, scaling and rotation).
2) Those 4 points now need to be filled or texturized, manually by you - this is the really difficult task.
Normally, one would use a API like OpenGL or DirectX to ease. I just did a quick Google for a PHP OpenGL extension:
http://developers.slashdot.org/article. ... /08/207210
Doesn't look very promising, likely because most people would just use another technology for 3D rendering. C/C++ are your best bet.
Calculation of three dimensional points is not very complex, but the flooding of those polygons is what is really killer (in terms of algorithm and CPU speed, etc).
I can dig up the formula for calculating 3D coordinates, but that is only half the battle. The flooding and shading, etc is what makes 3D what it is. It's really complex, especially if you don't understand the math involved -- which I don't.
In short, what you want to do, is going to be waaaay more work than what it's worth. You would be better off using JavaScript and VML, as opposed to native PHP.
Maybe something like this would help get you started:
http://www.dawnofthegeeks.com/software_ ... e=tutorial
Cheers
