使用顶点动画中的广告牌技术(Billboarding),来实现大卢恩在竖直方向上保持始终朝向玩家的效果。
1、广告牌技术原理
公告牌技术根据观察方向旋转纹理颜色的多边形,这通常用于渲染烟、云、火焰等。
[En]
Billboard technology rotates a texture-colored polygon according to the direction of view, which is usually used to render smoke, clouds, flames, and so on.
使用三个向量确定这个广告牌的方向:
- 表面法线(normal)
- 指向上的方向(up)
- 指向右的方向( right)
存在两种广告牌:
- 广告牌完全朝向摄像机。此时广告牌的法向量就是视角方向
- 广告牌面向相机,同时保持垂直。(如《埃尔登的戒指》中的大卢恩)此时广告牌的向上方向总是垂直的。
[En]
the billboard faces the camera while keeping it vertical. (such as Big Luhn in Elden's Ring) the upward direction of the billboard is always vertical at this time.*
构建这三个向量的过程:
- 通过初始计算得到广告牌的表面法线(即视角方向) 和指向上的方向。