Tag Info

Hot answers tagged

4

All 3D rotation must occur about some axis. That's what 3D rotation is. However, not all such rotation occurs about the Z axis. Rotation can be about any axis: X, Y, Z or an arbitrary axis not aligned with any of the principle axes of the coordinate system. What it sounds like you're referring to is the convention of rotating 2D shapes in a 2D plane about ...


1

Short answer: by smart compositing rotation and translation. In the image below you can see the process (radius r is distance of your planet from star). If you rotate the moon by rot_m degrees(updated in main loop), it will circle the origin point. If you first rotate and then translate by radius r it will circle in right distance but wont follow your ...


1

I don't know if this is a typo in your question or the actual mistake: x = normalize(Oa); v = normalize(Ob); z = a.crossProduct(b); y = x.crossProduct(z); For one you don't seem to be using v at all, but your z looks wrong to me. Did you mean the following? z = normalize(Oa.crossProduct(Ob)); Note the Oa and Ob instead of a and b. The difference is the ...


1

You could do something as simple as XMVector3TransformNormal of the direction light with the original Rotation. Generally in SIMD-friendly coding, individual component access is a performance hit, so you want to avoid doing it whenever possible. That's why in DirectXMath (aka XNAMath version 3) the individual element members _11 - _44 were removed from ...



Only top voted, non community-wiki answers of a minimum length are eligible