diff --git a/main.lua b/main.lua index 5d3deda..1b79be3 100644 --- a/main.lua +++ b/main.lua @@ -7,5 +7,8 @@ function init() end function update(delta) - print(couch.root:find_node("cube"):get_transform().position[3]) + local transform = couch.root:find_node("cube"):get_transform() + transform.rotation[2] = transform.rotation[2] + delta + transform.rotation[1] = transform.rotation[1] - delta * 0.3 + couch.root:find_node("cube"):set_transform(transform) end diff --git a/src/main.rs b/src/main.rs index e063864..2da4b1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -109,6 +109,8 @@ fn main() { let mvp = glm::perspective::(4.0/3.0, 45.0_f32.to_radians(), 0.2, 100.0); let mvp = glm::translate::(&mvp, &cube.get_transform().position); let mvp = glm::rotate_x(&mvp, cube.get_transform().rotation.x); + let mvp = glm::rotate_y(&mvp, cube.get_transform().rotation.y); + let mvp = glm::rotate_z(&mvp, cube.get_transform().rotation.z); let uniforms = uniform! { MVP: *mvp.as_ref(),