图形 - 将 3d 点转换为 2d 投影的方程 [英] Graphics - equation to convert 3d point to 2d projection
问题描述
我是图形新手,但正在使用 HTML5 Canvas、javascript 以及一些形状和图像.如果我在 Cx、Cy、Cz 点有一个相机,在 Px、Py、Pz 点有一个点,那么将点转换为 2d 点的最简单方法是什么,以便我可以在该点以正确的缩放比例渲染图像我的观点是正确的?我追求的是方程式,而不是图书馆.
I am a graphics novice, but am playing with HTML5 Canvas, javascript and some shapes and images. If I have a camera at point C.x,C.y,C.z, and a point at P.x,P.y,P.z, what is the easiest way to convert the point to a 2d point so I can render an image at that point with the correct scaling so my perspective is correct? I'm after the equations, not a library.
谢谢!
推荐答案
它被称为透视投影,您寻求的公式只是这里的矩阵乘法:
It is called the Perspective Projection and the formula you seek is just the matrix-multiplication found here:
http://en.wikipedia.org/wiki/3D_projection#Perspective_projection
这篇关于图形 - 将 3d 点转换为 2d 投影的方程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!