normalize camera direction
This commit is contained in:
parent
6a87119c70
commit
d84e5f8610
@ -421,7 +421,7 @@ void draw_camera(Vec3 position, Vec3 direction, Vec3 up, float fov, float zoom)
|
|||||||
Camera const camera = {
|
Camera const camera = {
|
||||||
.fov = fov,
|
.fov = fov,
|
||||||
.pos = position,
|
.pos = position,
|
||||||
.target = direction,
|
.target = vec3_norm(direction),
|
||||||
.up = up,
|
.up = up,
|
||||||
.viewbox = {
|
.viewbox = {
|
||||||
(Vec2){ 1/-zoom, 1/zoom },
|
(Vec2){ 1/-zoom, 1/zoom },
|
||||||
@ -459,7 +459,7 @@ DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position,
|
|||||||
Camera const camera = {
|
Camera const camera = {
|
||||||
.fov = fov,
|
.fov = fov,
|
||||||
.pos = position,
|
.pos = position,
|
||||||
.target = m_vec_norm(((Vec3){
|
.target = vec3_norm(((Vec3){
|
||||||
yawc * pitchc,
|
yawc * pitchc,
|
||||||
pitchs,
|
pitchs,
|
||||||
yaws * pitchc,
|
yaws * pitchc,
|
||||||
|
Loading…
Reference in New Issue
Block a user