smooth translation combined with compas

心已入冬 提交于 2019-12-11 20:25:33

问题


I'm building augmented reality app for android and I'm using jMonkey as my 3D engine. I want to do simple thing. Move object from left side of screen to right (X axis) by changing the azimuth of view (I got it from compass). I can calculate where the object is (rendered object has gps location) so I can say am I looking directly or maybe it is on the left or right. Now my problem is smooth move and calculate the change for local translation. My questions are: 1. how can I calculate position in local translation for the object based on azimuth thay I have 2. how make the change of local translation smooth. Now when I change the value from (for example) -4 to -1 the Spatial jumps. I would like to move it smoothly. I've tried to use Cinematic but either it is not for that or I'm not using it properly

About the calculating I've tried something like this

(objectAzimuth - azimuthWhereIlook) / offset

where offset is the scrope of X axis for example if my scope is <-20, 20> the offset is 40

the diffrence

 (objectAzimuth - azimuthWhereIlook)

is a proper way of checking where the object is according to two azimuth (I have strong math for that and I've this is working. Based on that I know where the object is (directly, on left, on right). So I have the point where the object should be on screen but I don't know how to cast it on X axis

来源:https://stackoverflow.com/questions/30479970/smooth-translation-combined-with-compas

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