OpenGL 中的广告牌效果
我如何概念化让图像始终面向相机。我尝试使用三角函数与反正切以及从相机到图像的距离,但这看起来不太优雅。它还设置了图像旋转方式的界限。有没有更好的方式来进行广告牌?
How would I conceptualize getting an image to always face a camera. I tried using trigonometry with arctan and the distances from the camera to the images, however this did not seem very graceful. It also set a bound on how for the image can rotate. Is there a better way to go about billboarding?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据涉及的角度,广告牌有 3 种类型:
正如您可能已经注意到的 - 如果广告牌与摄像机角度匹配,一切都与旋转有关。你有一个具有不同方向的相机对象吗?如果是 - 你只需采取角度并使用它们(广告牌应该面向相机,而不是模仿它,因此法线方向将被反转(当相机朝北时,广告牌朝相反的方向 - 南))。如果没有 - 你应该买一台相机。
There are 3 type of billboards, by angles involved:
As you might have already noticed - everything is about rotation, if billboard matches the camera angles. Do you have a Camera object with distinct orientation? If yes - you just take the angles and use them (billboard should face the camera, not mimic it, so the normal direction gonna be inversed (when camera faces north, billboard faces the opposite - south)). If no - you should get a Camera.