ch.dieseite.colladaloader.asmbeans

## Class Blender

- java.lang.Object
- - ch.dieseite.colladaloader.asmbeans.Blender

-     public class Blender
      extends java.lang.Object

  The handler for proprietary issues. It contains static methods:

- they work for Blender only
- is defined in LinkingSchema.xml
- is invoked by DataAssembler
- doing small defined jobs
- do not change behavior to other methods but invoke order may be important

This source is free; you can redistribute it and/or modify it under the terms of the GNU General Public License and by nameing of the originally author

Version:
  3.1
Author:
  Markus Zimmermann http://www.die-seite.ch

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `Blender.CoordData` wrapper for parsed vertex/texcoord data

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Blender()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Color` | `createColor(java.util.ArrayList<DataAssembler.Param> p)` creates a Color if <color> exist converts float values from 0-1(Blender) to 0-255(processing) Note that blender put no material attribute to <lines> (stupid impl) so a dummy color is generated
    `static java.util.ArrayList<Triangle>` | `createTriangles(java.util.ArrayList<DataAssembler.Param> p)` creates Triangles based on this polylist.
    `static Blender.CoordData` | `parseCoordData(java.util.ArrayList<DataAssembler.Param> p)` parses raw coord data from xml (polylist tag) to 'java readable' data
    `static void` | `sop(java.util.ArrayList<DataAssembler.Param> p)`
    `private static Point3D` | `transform(Point3D vertex, float[] matrix4x4)` Transforms a 3D Point with a 4x4 Matrix.
    `static void` | `transformShapes(java.util.ArrayList<DataAssembler.Param> p)` Transforms all Vertex Coords of Lines and/or Triangles (a stupid idea of blender)

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Blender

          public Blender()

  - ### Method Detail

    - #### sop

          public static void sop(java.util.ArrayList<DataAssembler.Param> p)

    - #### parseCoordData

          public static Blender.CoordData parseCoordData(java.util.ArrayList<DataAssembler.Param> p)

      parses raw coord data from xml (polylist tag) to 'java readable' data
      Parameters:
        `aPolyList` - tag (entry)
        `arg1` - = path to input tag semantic vertex
        `arg2` - = path to input tag semantic texture coords
        `arg3` - = path to float_array tag with vertex coords
        `arg4` - = path to float_array tag with texture coords
        `arg5` - = path to vcount tag
        `arg6` - = path to p tag
        `arg7` - = path to matrix tag
      Returns:
        coord raw data

    - #### createTriangles

          public static java.util.ArrayList<Triangle> createTriangles(java.util.ArrayList<DataAssembler.Param> p)

      creates Triangles based on this polylist. The coordinates is converted from Blender to Processing as follows: Note: convert is NOT COMPLETE: Vertex results must go through a 4x4 Matrix later

      textureProcessing x = textureBlender x * picture.width

      textureProcessing y = picture.height - textureBlender y * picture.height

      processing x = Blender x

      processing y = Blender -z

      processing z = Blender -y

      Parameters:
        `1.` - Raw coords (vertex+texture)
        `2.` - a Texture image
        `3.` - a Color (converted to processing)
        `4.` - the Collada interface
      Returns:
        a sublist for this polylist

    - #### createColor

          public static Color createColor(java.util.ArrayList<DataAssembler.Param> p)

      creates a Color if <color> exist converts float values from 0-1(Blender) to 0-255(processing) Note that blender put no material attribute to <lines> (stupid impl) so a dummy color is generated
      Parameters:
        `a` - <PolyList> tag from geometry with colorargs and transparencyArgs
      Returns:
        a color. if no valid colorargs then a dummy color is generated

    - #### transformShapes

          public static void transformShapes(java.util.ArrayList<DataAssembler.Param> p)

      Transforms all Vertex Coords of Lines and/or Triangles (a stupid idea of blender)
      Parameters:
        `1:` - ArrayList
        `2:` - ArrayList
        `3:` - CoordData

    - #### transform

          private static Point3D transform(Point3D vertex,
                                           float[] matrix4x4)

      Transforms a 3D Point with a 4x4 Matrix. It's assumed the Indexes [12-15] of 4x4 matrix is always 0,0,0,1
      Parameters:
        `vertex` -
        `matrix4x4` -
      Returns: