Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,


I am working on a 2D image where I have X and Y axis now I want to simulate Z axis by scaling the size of objects in image. but I am stuck with the calculation. I don't know how to scale the objects based on Z-Axis. I red this http://en.wikipedia.org/wiki/Transformation_matrix link but didn't proof very helpful.

Can anyone of you forward me to the right direction. I think I have successfully put my question on this email but if there is some thing missing please let me know .
Posted
Comments
Sergey Alexandrovich Kryukov 21-May-11 17:10pm    
I would say this is off-topic. Not really a programming question but a matter of elementary 3D geometry or higher analytical geometry, also not very difficult. It depends on your preference. And this is not just scaling. Do you need central projection or projection to a plain? You can to draw a picture with projection and do all calculation by yourself.
Doing it in HTML would be a bit awkward, would take time and space...
--SA

1 solution

First mistake in your post is that you want a Z-axis in 2d. Once you add a Z-axis you are now 3-D.
Doing 3D projection requires much more that just placement of an object on a screen with a few computations. First you need to establish a horizon. Then you need to know the location of the horizon in comparison to the location of the object. Then you need to determine the location of the focal point along that horizon. Without any of those elements you cannot even begin to write any algorithm projecting a 3D object in a 2D environment.

One thing you will need to do is google 3D drawing or buy a book on 3D game development. Somewhere you should find some degree of help. But as I said before there really is no formula you can use until you establish the points I listed above.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900