Normand Briere
2018-07-01 bb87fae3b097ddd5c5039bf1ab48d3718b900b08
Fix camera and hip height.
3 files modified
18 ■■■■■ changed files
CameraPane.java 8 ●●●● patch | view | raw | blame | history
Mocap.java 4 ●●●● patch | view | raw | blame | history
mocap/reader/BVHReader.java 6 ●●●● patch | view | raw | blame | history
CameraPane.java
....@@ -7693,7 +7693,7 @@
76937693
76947694 if (renderCamera != lightCamera)
76957695 for (int count = parentcam.GetTransformCount(); --count>=0;)
7696
- LA.matConcat(parentcam.toParent, matrix, matrix);
7696
+ LA.matConcat(matrix, parentcam.toParent, matrix);
76977697
76987698 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
76997699
....@@ -7709,7 +7709,7 @@
77097709
77107710 if (renderCamera != lightCamera)
77117711 for (int count = parentcam.GetTransformCount(); --count>=0;)
7712
- LA.matConcat(matrix, parentcam.fromParent, matrix);
7712
+ LA.matConcat(parentcam.fromParent, matrix, matrix);
77137713
77147714 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
77157715
....@@ -8915,7 +8915,7 @@
89158915 // if (parentcam != renderCamera) // not a light
89168916 if (cam != lightCamera)
89178917 for (int count = parentcam.GetTransformCount(); --count>=0;)
8918
- LA.matConcat(parentcam.toParent, matrix, matrix);
8918
+ LA.matConcat(matrix, parentcam.toParent, matrix);
89198919
89208920 for (int j = 0; j < 4; j++)
89218921 {
....@@ -8930,7 +8930,7 @@
89308930 // if (parentcam != renderCamera) // not a light
89318931 if (cam != lightCamera)
89328932 for (int count = parentcam.GetTransformCount(); --count>=0;)
8933
- LA.matConcat(matrix, parentcam.fromParent, matrix);
8933
+ LA.matConcat(parentcam.fromParent, matrix, matrix);
89348934
89358935 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
89368936
Mocap.java
....@@ -3056,8 +3056,8 @@
30563056
30573057 void Reset()
30583058 {
3059
- if (fullname != null)
3060
- ReadBVH();
3059
+// if (fullname != null)
3060
+// ReadBVH();
30613061
30623062 Object3D hip = get(0);
30633063
mocap/reader/BVHReader.java
....@@ -180,8 +180,12 @@
180180 b.setParent(parent);
181181 // EXTRA JOINTS
182182 // parent.attachGeom(n.offset, maxRadius, joints);
183
+
184
+ b.setBaseTranslation(n.offset);
183185 }
184
- b.setBaseTranslation(n.offset);
186
+ else
187
+ // Not for hip because the height is already factored in the mocap data.
188
+ b.setBaseTranslation(new Vector3d());
185189
186190 // for horse
187191 // if (n.name.equals("tail1"))