creating transformation
using System.Windows.Media.Media3D;
using HelixToolkit.Wpf;
public Matrix3D CalculateAttitudeMatrix(double yaw, double pitch, double roll)
{
// Convert angles to radians
double yawRad = yaw * Math.PI / 180.0;
double pitchRad = pitch * Math.PI / 180.0;
double rollRad = roll * Math.PI / 180.0;
// Create rotation matrices
var yawRotation = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), yaw)).Value;
var pitchRotation = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 1, 0), pitch)).Value;
var rollRotation = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), roll)).Value;
// Combine rotations (order matters: first yaw, then pitch, then roll)
return rollRotation * pitchRotation * yawRotation;
}
applying
Matrix3D attitudeMatrix = CalculateAttitudeMatrix(yaw, pitch, roll); // Apply the transformation to your model yourModel.Transform = new MatrixTransform3D(attitudeMatrix);