Package net.br410bury.graphics

Examples of net.br410bury.graphics.GraphicsMatrix


   * @param motion The motion which is associated with this joint.
   * @return A graphics matrix describing the transformation of this joint.
   */
  public GraphicsMatrix getTransformation(int frame, Motion motion)
  {
    GraphicsMatrix g = new GraphicsMatrix();
   
    if(channels != null)
    {
      for(int ch = channels.length-1; ch >= 0; ch--)
      {
        if(channels[ch].isRotation())
        {
          g.transform(motion.getChannel(frame, start + ch) * Math.PI / 180, channels[ch]);
        }
        else
        {
          g.transform(motion.getChannel(frame, ch), channels[ch]);
        }
      }
    }
   
    if(parent != null) g.transform(offsets, offsetchannels);
   
    return g;
  }
View Full Code Here


   * @param motion The motion which is associated with this joint.
   * @return A graphics matrix describing the transformation of this joint.
   */
  public GraphicsMatrix getTranslation(int frame, Motion motion)
  {
    GraphicsMatrix g = new GraphicsMatrix();
    double[] amounts;
   
    amounts = new double[channels.length];
    System.arraycopy(motion.getFrame(frame), start, amounts, 0, channels.length);
   
    g.eye();
    g.translate(amounts, channels);
   
    return g;
  }
View Full Code Here

 
 
 
  protected void recursiveSegment(int frame, Bone bone, Joint node, GraphicsMatrix global)
  {
    GraphicsMatrix local;
    Bone localbone = new Bone();
   
    local = global.times(node.getTransformation(frame, motion));
    localbone.setStart(local.times(matrixToPoint));
    bone.addEnd(localbone);
    for(Joint child : node.getChildren())
    {
      if(!child.isEndSite()) recursiveSegment(frame, localbone, child, local);
    }
View Full Code Here

   * @param motion The motion which is associated with this joint.
   * @return A graphics matrix describing the transformation of this joint.
   */
  public GraphicsMatrix getRotation(int frame, Motion motion)
  {
    GraphicsMatrix g = new GraphicsMatrix();
   
    for(int ch = channels.length-1; ch >= 0; ch--)
    {
      g.rotate(motion.getChannel(frame, ch) * Math.PI / 180, channels[ch]);
    }
   
    return g;
  }
View Full Code Here

  /**
   * Segments all frames.
   */
  public void segment()
  {
    GraphicsMatrix global;
   
    rootbone = new Bone[motion.getFrames()];
    for(int frame = 0; frame < motion.getFrames(); frame++) segment(frame);
  }
View Full Code Here

   *
   * @param frame The frame to segment.
   */
  public void segment(int frame)
  {
    GraphicsMatrix global;
   
    if(rootbone == null) rootbone = new Bone[motion.getFrames()];
    if(rootbone[frame] == null)
    {
      rootbone[frame] = new Bone();

      global = root.getTransformation(frame, motion);
      rootbone[frame].setStart(global.times(matrixToPoint));
      for(Joint child : root.getChildren())
      {
        recursiveSegment(frame, rootbone[frame], child, global);
      }
    }
View Full Code Here

TOP

Related Classes of net.br410bury.graphics.GraphicsMatrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.