content

Apparently, this code is frame dependent:

extends Node3D

var spin := Quaternion.from_euler(Vector3(10, 10, 10))

func _process(delta: float) -> void:
	quaternion *= spin * delta

This is because spin is a Quaternion, and multiplying it by delta only does a component-wise multiplication. It makes sense to me that a component-wise multiplication would not do what I expect here, since the individual quaternion components do not really represent a rotation in a particular direction.

In order to scale the rotation, I have to use slerp. For example:

func _process(delta: float) -> void:
	quaternion *= Quaternion.IDENTITY.slerp(spin, delta)

meta

created:

backlinks: 20250806040412 Quaternion rotation is frame dependent

commit: 6287f83c