Changes to FreeWRL to get crowd_hanim_multi.x3d working: HAnimPermuter : X3DChildNode { MFNode [in,out] humanoids [] [HAnimHumanoid] MFNode [in,out] motions [] [HAnimMotion, HAnimMotionData*] SFBool [in,out] compute FALSE MFInt32 [out] permutations SFInt32 [in,out] index -1 SFNode [out] humanoid [HAnimHumanoid] } Optional refactoring of HAnimMotion: HAnimMotion : HAnimMotionPlay, HAnimMotionData HAnimMotionDataFile : HAnimMotionData ParticleSystem { # added HANIM geometryType: SFString [] geometryType "QUAD" ["LINE"|"POINT"|"QUAD"|"SPRITE"|"TRIANGLE"|"GEOMETRY"|"HANIM"|...] MapEmitter : X3DParticleEmitterNode { # standard X3DParticleEmitter emitter fields SFVec3f [in,out] position 0 0 0 SFFloat [in,out] speed 0 SFFloat [in,out] variation 0.25 # MapEmitter specific fields SFNode [in,out] functionMap NULL [X3DSingleTextureNode] SFVec2f [] gridSize 1 1 MFColor [] emitterColor [] SFFloat [] colorMatchTolerance .01 SFBool [in,out] classified FALSE } MapPhysicsModel : X3DParticlePhysicsModelNode { SFNode [in,out] functionMap NULL [X3DSingleTextureNode] SFColor [] obstacleColor 0 0 0 MFColor [] sinkColor [] SFColor [] pauseColor 1 0 0 SFBool [in,out] pauseState FALSE SFFloat [] colorMatchTolerance .01 SFVec2f [] gridSize 1 1 SFBool [in,out] classified FALSE } Internal particle struct changes: typedef struct { //no-changes: // store at end of current iteration, for use on next iteration float age; float lifespan; //assigned at birth float size[2]; //assigned at birth float position[3]; float velocity[3]; float origin[3]; //zero normally. For boundedphysics, updated on each reflection to be last reflection point. float speed; float mass; float surfaceArea; typedef struct { //added for HANIM particles, but could be used for other particles: float direction[3]; //normalized last non-zero velocity vector //added for mapemitter method int sink; //assigned after birth in MapPhysics, for MapPhysics, MapEmitter int maplocation[2]; //last popmap location in MapPhysics int paused; //HANIM 0= use first motion 1= use second motion double transitionStart[2]; double transitionTime[2]; double _startTime[2]; int lastMotionsEnabled[2]; //added for mapemitter + HAnimPermuter method (could be generalized to more emitters?) int permutationIndex; } particle; Refactoring of particle loop for regular geometry vs HANIM: HANIM: - doesn't behave like Shape node, ignores materials on ParticleSystem - delegates appearance, shader setup, to humanoid rendering