从 2D 投影映射回 3D 点云 [英] Mapping from 2D projection back to 3D point cloud

查看:45
本文介绍了从 2D 投影映射回 3D 点云的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由点顶点 (XYZ) 和最终三角形面组成的 3D 模型.使用 OpenGL 或相机视图矩阵投影,我可以将 3D 模型投影到 2D 平面,即具有 m*n 分辨率的视图窗口或图像.

I have a 3D model consisting of point vertices (XYZ) and eventually triangular faces. Using OpenGL or camera-view-matrix-projection I can project the 3D model to a 2D plane, i.e. a view window or an image with m*n resolution.

问题是如何确定 2D 投影计划中的像素与其对应的原始 3D 模型中的顶点(或面)之间的对应关系.

The question is how can I determine the correspondence between a pixel from the 2D projection plan and its corresponding vertex (or face) from the original 3D model.

也就是说,
对于来自 2D 投影的给定像素,3D 模型中最近的顶点是什么?
这听起来像是在选择 openGL 或光线追踪问题.但是有什么简单的解决方案吗?

Namely,
What is the closest vertices in 3D model for a given pixel from 2D projection?
It sounds like picking in openGL or raytracing problem. Is there however any easy solution?

有了光线追踪的想法,它实际上就是从一个视点找到与光线相交的第一个顶点/面.有人可以给我看一些教程或示例吗?我想找到一种独立于使用 OpenGL 的算法.

With the idea of ray tracing it is actually about finding the first vertex/face intersected with the ray from a view point. Can someone show me some tutorial or examples? I would like to find an algorithm independent from using OpenGL.

推荐答案

OpenGL 中的命中测试通常无需光线跟踪即可完成.相反,当每个图元被渲染时,输出中的一个平面用于存储图元的唯一 ID.命中测试就像读取光标位置的 ID 平面一样简单.

Hit testing in OpenGL usually is done without raytracing. Instead, as each primitive is rendered, a plane in the output is used to store the unique ID of the primitive. Hit testing is then as simple as reading the ID plane at the cursor location.

这篇关于从 2D 投影映射回 3D 点云的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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