Skip to content

Commit f60fe3f

Browse files
committed
fix: Update mesh transform on every frame to enable rotation controls
The cube wasn't rotating because the scene was created once with initial rotation values and never updated. The renderUpdate callback was updating the rotation variables but not applying them to the actual mesh. Fixed by: - Casting rendererInterface to *SceneRenderer in renderUpdate - Calling UpdateMeshTransform with current rotation values on every frame - This matches the pattern from the original working implementation Now both auto-rotation and manual controls (arrow buttons/keys) work correctly by updating the mesh transform in real-time. Note: The Guix DSL parser doesn't support complex if statements in function literals, so this fix is applied directly to the generated app_gen.go file.
1 parent ed3c1ec commit f60fe3f

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

examples/webgpu-cube/app.gx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import "fmt"
4+
import "github.com/gaarutyunov/guix/pkg/runtime"
45

56
func App() (Component) {
67
rotationX := 0.0

examples/webgpu-cube/app_gen.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)