Dentaawp Posted November 9, 2022 Share Posted November 9, 2022 Hello, i'm still a newbie in this c# coding, i want to ask about how to set the rotation of the sun object so that it can display morning, noon, and night in c# code. Link to comment
thomalex Posted November 9, 2022 Share Posted November 9, 2022 Hello @Dentaawp, You can set the rotation of any node by means of the SetRotation(quat q) method: vec3 EulerAngles = vec3.ZERO; mat4 rot = MathLib.ComposeRotationXYZ(EulerAngles); node.SetWorldRotation(new quat(rot)); I'd also suggest to take a look at the Transformation section of the C# Component Samples to get familiar with rotation composition/decomposition. The Programming Quick Start series also might help with basic concepts. Thanks! Link to comment
Recommended Posts