Exemple #1
0
        private void Animation(int index)
        {
            model1.StartAnimation(1, animationSteps);
            AnimatedBlockRef br = (AnimatedBlockRef)shapes[index];

            br.animate = true;
            br.deltaT  = 1.0 / animationSteps;
        }
Exemple #2
0
        private void AddBlockDefinition(Block block, int index)
        {
            block.Entities.Add(shapes[index]);
            model1.Blocks.Add(block);

            // Create a blockReference
            AnimatedBlockRef br = new AnimatedBlockRef(shapesTransform[index], block.Name);

            // Store the orientation quaternions
            br.startOrientation = startOrientation[index];
            br.finalOrientation = finalOrientation[index];

            // Store the translation vector between initial and final positions
            br.translationVect = Vector3D.Subtract(inners[index].Vertices[0], br.Transformation * block.Entities[0].Vertices[0]);

            // Store the first point (for correct rotation around origin)
            br.firstPt = (Point3D)block.Entities[0].Vertices[0].Clone();

            // Initialize the data for animation
            br.Init();

            // Put the BlockReference in the shapes array
            shapes[index] = br;
        }