[x3d-public] HAnim X3DJSAIL question. Adding joint to humanoid.

Don Brutzman brutzman at nps.edu
Sat Mar 17 12:10:41 PDT 2018


On 3/17/2018 11:40 AM, John Carlson wrote:
> I believe it’s addJoints().

Correct for the top-level USE node references.  However use addChild for constructing the skeleton.

Please see Javadoc and examples.

http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/HAnim/package-summary.html
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/HAnim/HAnimHumanoidObject.html
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/HAnim/HAnimHumanoidObject.html#addJoints-org.web3d.x3d.jsail.HAnim.HAnimJointObject-

http://www.web3d.org/x3d/content/examples/Basic/javadoc/Basic/HumanoidAnimation
http://www.web3d.org/x3d/content/examples/Basic/javadoc/Basic/HumanoidAnimation/package-summary.html

example
http://www.web3d.org/x3d/content/examples/Basic/HumanoidAnimation/DiamondManLOA_1Index.html
http://www.web3d.org/x3d/content/examples/Basic/HumanoidAnimation/DiamondManLOA_1.x3d
http://www.web3d.org/x3d/content/examples/Basic/javadoc/Basic/HumanoidAnimation/DiamondManLOA_1.html
http://www.web3d.org/x3d/content/examples/Basic/HumanoidAnimation/DiamondManLOA_1.java

excerpts from original .x3d and autogenerated .java:

<Scene>
   <WorldInfo info='[omitted]' title='HANIM 1.1 Default Joint Centers, LOA1'/>
   <NavigationInfo speed='1.5'/>
   <HAnimHumanoid DEF='DiamondMan' info='[omitted]' name='humanoid' version='2.0'>
	<HAnimJoint DEF='hanim_HumanoidRoot' center='0.0 0.8240 0.0277' containerField='skeleton' name='HumanoidRoot'>
	  <HAnimJoint DEF='hanim_sacroiliac' center='0.0 0.9149 0.0016' name='sacroiliac'>
		<Transform translation='0.0 0.9149 0.0016'>
		  <Shape DEF='DiamondShape'>

.setScene(new SceneObject()
   .addChild(new WorldInfoObject().setInfo(WorldInfo_3_28_info).setTitle("HANIM 1.1 Default Joint Centers, LOA1"))
   .addChild(new NavigationInfoObject().setSpeed(1.5f))
   .addChild(new HAnimHumanoidObject("DiamondMan").setName("humanoid").setInfo(DiamondMan_3_30_info).setVersion("2.0")
	.addSkeleton(new HAnimJointObject("hanim_HumanoidRoot").setName("HumanoidRoot").setCenter(0.0f,0.8240f,0.0277f)
	  .addChild(new HAnimJointObject("hanim_sacroiliac").setName("sacroiliac").setCenter(0.0f,0.9149f,0.0016f)
		.addChild(new TransformObject().setTranslation(0.0f,0.9149f,0.0016f)
		  .addChild(new ShapeObject("DiamondShape")
[etc.]


<HAnimJoint USE='hanim_HumanoidRoot' containerField='joints'/>
<HAnimJoint USE='hanim_sacroiliac' containerField='joints'/>
<HAnimJoint USE='hanim_l_hip' containerField='joints'/>
<HAnimJoint USE='hanim_l_knee' containerField='joints'/>
<HAnimJoint USE='hanim_l_ankle' containerField='joints'/>

       .addJoints(new HAnimJointObject().setUSE("hanim_HumanoidRoot"))
       .addJoints(new HAnimJointObject().setUSE("hanim_sacroiliac"))
       .addJoints(new HAnimJointObject().setUSE("hanim_l_hip"))
       .addJoints(new HAnimJointObject().setUSE("hanim_l_knee"))
       .addJoints(new HAnimJointObject().setUSE("hanim_l_ankle"))
[etc.]


> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Saturday, March 17, 2018 12:41 AM
> *To: *x3d-public at web3d.org <mailto:x3d-public at web3d.org>
> *Subject: *HAnim X3DJSAIL question. Adding joint to humanoid.
> 
> HAnimHumanoid14.addSkin(HAnimJoint15)
> 
> What is the correct method for adding a joint to a humanoid?  Source not attached because of size.    There may not be a way to do this in X3D 3.3.  I am not sure.  I will get around to checking the object model eventually, but if anyone knows without looking.  It probably has something to do with the field the joint goes in, like skin, etc.
> 
> John
> 
> $ python NancyNativeTags.py
> 
> Traceback (most recent call last):
> 
>    File "NancyNativeTags.py", line 624, in <module>
> 
>      HAnimHumanoid14.addSkin(HAnimJoint15)
> 
>    File "jnius\jnius_export_class.pxi", line 906, in jnius.JavaMultipleMethod.__call__ (jnius\jnius.c:29116)
> 
>    File "jnius\jnius_export_class.pxi", line 638, in jnius.JavaMethod.__call__ (jnius\jnius.c:25527)
> 
>    File "jnius\jnius_export_class.pxi", line 715, in jnius.JavaMethod.call_method (jnius\jnius.c:26510)
> 
>    File "jnius\jnius_utils.pxi", line 93, in jnius.check_exception (jnius\jnius.c:4618)
> 
> jnius.JavaException: JVM exception occurred: X3DNode newValue is not instanceof acceptableNodeTypes Group|Transform|Shape|IndexedFaceSet; newValue=org.web3d.x3d.jsail.HAnim.HAnimJointObject at 24111ef1
> 
> 
> 
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
> 


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman




More information about the x3d-public mailing list