public void SetFrame(int timecode) { SimPe.Geometry.Vector3f v = this.frames[timecode]; Ambertation.Scenes.Transformation trans = new Ambertation.Scenes.Transformation(); if (afb.TransformationType == FrameType.Translation) { if (timecode != 0) { trans.Translation.X = v.X; trans.Translation.Y = v.Y; trans.Translation.Z = v.Z; } //else nb.Transform = mt; } else { if (timecode != 0) { trans.Rotation.X = v.X; trans.Rotation.Y = v.Y; trans.Rotation.Z = v.Z; } } //mb.Transform = Microsoft.DirectX.Matrix.Multiply(mb.Transform, Ambertation.Scenes.Converter.ToDx(trans)); mb.Transform = Ambertation.Scenes.Converter.ToDx(trans); }
internal void TNUpdateTextValues(SimPe.Geometry.Quaternion q, bool quat, bool axis, bool euler) { //set Angles try { this.tb_tn_a.Tag = true; if (quat) { this.tb_tn_rx.Text = q.X.ToString("N6"); this.tb_tn_ry.Text = q.Y.ToString("N6"); this.tb_tn_rz.Text = q.Z.ToString("N6"); this.tb_tn_rw.Text = q.W.ToString("N6"); } if (axis) { this.tb_tn_ax.Text = q.Axis.X.ToString("N6"); this.tb_tn_ay.Text = q.Axis.Y.ToString("N6"); this.tb_tn_az.Text = q.Axis.Z.ToString("N6"); this.tb_tn_a.Text = SimPe.Geometry.Quaternion.RadToDeg(q.Angle).ToString("N6"); } if (euler) { SimPe.Geometry.Vector3f ea = q.GetEulerAngles(); this.tb_tn_ey.Text = SimPe.Geometry.Quaternion.RadToDeg(ea.Y).ToString("N6"); this.tb_tn_ep.Text = SimPe.Geometry.Quaternion.RadToDeg(ea.X).ToString("N6"); this.tb_tn_er.Text = SimPe.Geometry.Quaternion.RadToDeg(ea.Z).ToString("N6"); } } finally { this.tb_tn_a.Tag = null; } }
public SimPe.Geometry.Quaternion InverseTransformRotation(SimPe.Geometry.Quaternion q) { SimPe.Geometry.Vector3f r = q.Axis; r = this.InverseTransform(r); q = SimPe.Geometry.Quaternion.FromAxisAngle(r, q.Angle); return(q); }
/// <summary> /// the inveres to <see cref="Scale"/> /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f InverseScale(SimPe.Geometry.Vector3f v) { return(msi * v); }
/// <summary> /// Scale the passed Vector /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f Scale(SimPe.Geometry.Vector3f v) { return(ms * v); }
/// <summary> /// the inveres to <see cref="TransformScaled"/> /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f InverseTransformScaled(SimPe.Geometry.Vector3f v) { return(!(m * ms) * v); }
/// <summary> /// Transform the passed vector to fit into the specified Coordinate System and Scale /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f TransformScaled(SimPe.Geometry.Vector3f v) { return((m * ms) * v); }
/// <summary> /// the inveres to <see cref="TransformNormal"/> /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f InverseTransformNormal(SimPe.Geometry.Vector3f v) { return(mni * v); }
/// <summary> /// Transform the passed normalvector to fit into the specified Coordinate System /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f TransformNormal(SimPe.Geometry.Vector3f v) { return(mn * v); }
/// <summary> /// Transform the passed vector to fit into the specified Coordinate System /// </summary> /// <param name="v"></param> /// <returns></returns> public SimPe.Geometry.Vector3f Transform(SimPe.Geometry.Vector3f v) { return(m * v); }