Skip to content

Commit

Permalink
Deleted the lines pointing out from each bone in the skeleton rendere…
Browse files Browse the repository at this point in the history
…r, because these are just distracting and aren't very robust.
  • Loading branch information
MeltyPlayer committed Oct 28, 2023
1 parent e7440a2 commit 440e38f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,55 +74,6 @@ public void Render() {
GL.End();
}

// Renders lines out from each bone in its direction.
{
GL.LineWidth(5);
GL.Begin(PrimitiveType.Lines);

GL.Color4(1f, 0, 0, 1);

foreach (var bone in this.Skeleton) {
if (bone == rootBone || bone == this.SelectedBone) {
continue;
}

var from = new Vector3();
this.boneTransformManager_.ProjectPosition(bone, ref from);

var normal = new Vector3(1, 0, 0);
this.boneTransformManager_.ProjectNormal(bone, ref normal);

var normalScale = 50f / this.Scale;
normal = Vector3.Multiply(normal, normalScale);

GL.Vertex3(Unsafe.As<Vector3, OpenTK.Vector3>(ref from));
GL.Vertex3(from.X + normal.X, from.Y + normal.Y, from.Z + normal.Z);
}

GL.End();

if (this.SelectedBone != null) {
GL.LineWidth(8);
GL.Begin(PrimitiveType.Lines);

GL.Color4(1f, 1f, 1f, 1);

var from = new Vector3();
this.boneTransformManager_.ProjectPosition(this.SelectedBone, ref from);

var normal = new Vector3(1, 0, 0);
this.boneTransformManager_.ProjectNormal(this.SelectedBone, ref normal);

var normalScale = 50f / this.Scale;
normal = Vector3.Multiply(normal, normalScale);

GL.Vertex3(Unsafe.As<Vector3, OpenTK.Vector3>(ref from));
GL.Vertex3(from.X + normal.X, from.Y + normal.Y, from.Z + normal.Z);

GL.End();
}
}

// Renders points at the start of each bone.
{
GL.PointSize(8);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.Numerics;

using SharpGLTF.Materials;
Expand Down

0 comments on commit 440e38f

Please sign in to comment.