在2D中模拟Z轴 [英] Simulate Z axis in 2D

查看:286
本文介绍了在2D中模拟Z轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在处理具有X和Y轴的2D图像,现在我想通过缩放图像中对象的大小来模拟Z轴.但我坚持计算.我不知道如何基于Z轴缩放对象.我将此http://en.wikipedia.org/wiki/Transformation_matrix链接设为红色,但并没有证明非常有用.

你们中的任何人都可以将我转发给正确的方向.我认为我已经成功地在电子邮件中提出了问题,但是如果缺少某些内容,请通知我. 2D中的Z轴.添加Z轴后,您现在将成为3-D.
进行3D投影所需要的不仅是通过一些计算就能将对象放置在屏幕上.首先,您需要建立一个视野.然后,您需要知道与对象位置相比的地平线位置.然后,您需要确定沿该地平线的焦点位置.没有这些元素,您甚至无法开始编写在2D环境中投射3D对象的任何算法.

您需要做的一件事是Google 3D绘图或购买有关3D游戏开发的书.在某个地方,您应该找到一定程度的帮助.但是正如我之前所说的,在建立上面列出的要点之前,实际上没有公式可以使用.


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 .

解决方案

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.


这篇关于在2D中模拟Z轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆