public Model3D(int id = -1, String name = "") { Id = id; Name = name; Meshes = new List<Mesh>(); Transformation = Transformation.Identity; oldTransformation = Transformation.Identity; }
public static Transformation Lerp(Transformation t1, Transformation t2, float value) { Transformation t = new Transformation(); t.Translation = Vector3.Lerp(t1.Translation, t2.Translation, value); t.Rotation = Vector3.Lerp(t1.Rotation, t2.Rotation, value); t.Scaling = Vector3.Lerp(t1.Scaling, t2.Scaling, value); return t; }
public static Transformation Parse(String input) { Transformation t = new Transformation(); var lines = input.Split('\n'); foreach (var line in lines) { var line2 = line.Replace(" ", ""); var tokens = line2.Split('='); if (tokens[0] == "translation") t.Translation = ParseHelper.ParseVector3(tokens[1]); if (tokens[0] == "rotation") t.Rotation = ParseHelper.ParseVector3(tokens[1]); if (tokens[0] == "scaling") t.Scaling = ParseHelper.ParseVector3(tokens[1]); } return t; }
public void SaveTransformation() { oldTransformation = Transformation; SavedTransformation = true; }
public void ResetTransformation() { Transformation = oldTransformation; SavedTransformation = false; }
public void SetTransformation(Model3D model, int keyFrameIndex, Transformation transformation) { KeyFrameForIndex[keyFrameIndex].TransformationForModel[model] = transformation; }