public InterpolationEditor(ModelEditorBase mainWindow) { InitializeComponent(); _mainWindow = mainWindow; numFrameVal._integral = true; cbTransform.DataSource = _modes; interpolationViewer.SelectedKeyframeChanged += interpolationViewer1_SelectedKeyframeChanged; interpolationViewer.FrameChanged += interpolationViewer1_FrameChanged; interpolationViewer.SignalChange += interpolationViewer_SignalChange; nibTanLen.Value = interpolationViewer.TangentLength; }
public InterpolationForm(ModelEditorBase mainWindow) { InitializeComponent(); _interpolationEditor = new InterpolationEditor(mainWindow); TopMost = true; }
public ModelViewerForm(ModelEditorBase mainWindow) { InitializeComponent(); TopMost = true; }
public void Render(bool targetModel, ModelPanelViewport viewport, Vector3 parentPos = new Vector3()) { if (!_render) { return; } //Draw name if selected if (_nodeColor != Color.Transparent && viewport != null) { Vector3 screenPos = viewport.Camera.Project(_frameMatrix.GetPoint()); viewport.ScreenText[Name] = new Vector3(screenPos._x, screenPos._y - 9.0f, screenPos._z); } float alpha = targetModel ? 1.0f : 0.45f; //Set bone line color if (_boneColor != Color.Transparent) { GL.Color4(_boneColor.R / 255.0f, _boneColor.G / 255.0f, _boneColor.B / 255.0f, alpha); } else { GL.Color4(targetModel ? DefaultLineColor : DefaultLineDeselectedColor); } //Draw bone line Vector3 currentPos = _frameMatrix.GetPoint(); GL.Begin(BeginMode.Lines); GL.Vertex3((float *)&parentPos); GL.Vertex3((float *)¤tPos); GL.End(); //Set bone orb color if (_nodeColor != Color.Transparent) { GL.Color4(_nodeColor.R / 255.0f, _nodeColor.G / 255.0f, _nodeColor.B / 255.0f, alpha); } else { GL.Color4(DefaultNodeColor.R / 255.0f, DefaultNodeColor.G / 255.0f, DefaultNodeColor.B / 255.0f, alpha); } //Draw bone orb GL.PushMatrix(); bool ignoreBoneScale = true; bool scaleBones = viewport != null && viewport._renderAttrib._scaleBones; Matrix transform = _frameMatrix; if (ignoreBoneScale) { transform = Matrix.TranslationMatrix(currentPos) * _frameMatrix.GetRotationMatrix() * Matrix.ScaleMatrix(new Vector3(1.0f)); } if (viewport._renderAttrib._renderBonesAsPoints) { GL.MultMatrix((float *)&transform); if (!scaleBones) { GL.PointSize(1.0f / (ModelEditorBase.OrbRadius(this, viewport.Camera)) * 10.0f); } else { GL.PointSize(10.0f); } GL.Enable(EnableCap.PointSmooth); GL.Begin(BeginMode.Points); GL.Vertex3(0, 0, 0); GL.End(); } else { if (scaleBones) { transform.Scale(new Vector3(ModelEditorBase.OrbRadius(this, viewport.Camera))); } GL.MultMatrix((float *)&transform); //Orb TKContext.FindOrCreate <GLDisplayList>("BoneNodeOrb", CreateNodeOrb).Call(); //Axes DrawNodeOrients(alpha); } GL.PopMatrix(); //Render children foreach (MDL0BoneNode n in Children) { n.Render(targetModel, viewport, currentPos); } }
public InterpolationEditor() { _mainWindow = null; }