Get Pure View Matrix in Vuforia

久未见 提交于 2020-01-11 10:13:29

问题


I am using Vuforia SDK to build my AR app. By using trackableResult->getPose(), I can get a model view matrix of the target frame marker. But I also need pure view matrix to do some calculations. Is there any way to get it?


回答1:


To follow on from peedee's comment above, here is a picture I found extremely helpful, linked to from this web page.

Sorry I couldn't leave this as a comment, but they don't allow pictures in comments.

Note that different texts may use slightly different names for each space, but the overall idea should be the same!




回答2:


My first learning OpenGL was actually with Vuforia two months ago, and I have now concluded for myself that Vuforia's naming of variables in their examples is confusing.

I changed the name of what they call "modelViewMatrix_Vuforia" to "viewMatrix", because that's really what it is. It transforms points from world space to view space / eye space.

In my understanding the "model matrix" is something that will be unique to each model and will place my models with respect to each other. You don't necessarily need one; if your models are already defined in world space then you can just forget about it.

But if your models are imported (for example mine are made with Blender) then they are probably defined in model space, with the origin at their own center of mass. In that case you need a model matrix to place them away from the origin, otherwise all your models will be stacked onto each other.

Maybe what I wrote is not clear enough... I only just figured this out this week myself. I wanted to do environment reflection with a cubemap, and there I needed an inverted view matrix, which brought me exactly to the question you asked.



来源:https://stackoverflow.com/questions/29061257/get-pure-view-matrix-in-vuforia

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!