de.grogra.billboard
Class Billboarder

java.lang.Object
  extended by de.grogra.billboard.Billboarder
Direct Known Subclasses:
BasicBillboarder, CakeBillboarder, GridBillboarder

public abstract class Billboarder
extends java.lang.Object


Field Summary
protected  double angleOffset
           
protected  java.lang.String appendfix
           
protected  RotationCamera camera
           
protected  int countZero
           
protected  int currentSide
           
protected  java.io.File file
           
protected  java.lang.String imageFolder
           
protected  int imgHeight
           
protected  int imgWidth
           
protected  MimeType mt
           
static MimeType MT_EXR
          The MIME type image/exr without parameters.
static MimeType MT_JPG
          The MIME type image/jpeg without parameters.
static MimeType MT_PJPG
          The MIME type image/pjpeg without parameters.
static MimeType MT_PNG
          The MIME type image/png without parameters.
static MimeType MT_X_EXR
          The MIME type image/x-exr without parameters.
protected  java.lang.String pathAndFileName
           
protected  java.lang.String prefix
           
protected  double RotationAngle
           
protected  TVector3d rotationPoint
           
protected  int sides
           
protected  java.lang.String suffix
           
protected  View3D view3d
           
 
Constructor Summary
Billboarder()
           
 
Method Summary
 void angleOffset(int angleOffset)
          Shift the camera after the rotation to the value angleOffset.
 void beginAt(int side)
          The Billboarder starts at the given side.
 void billboarding()
          This method rendered each side of an object given in the view.
protected  void finalAction()
          This method is invoked after the last billboard was rendered.
protected  java.lang.String getBBName(int index)
          This method return the path and filename of the billboard as an URI-String
protected  java.lang.String getLeadingZeros(int limit, int position)
          This generates a string with leading zeros.
static GraphManager graph()
           
 void initialize(double distance, double zOfsset, int sides)
          This method has to be invoke before invoke .
protected  void insertName(java.lang.String name)
          Stores the name of a rendered billboard into an internal list.
static void justRenderView(java.io.File file, MimeType mt)
           
static Point3d location(Node node)
           
protected  void nextSide()
          Just put the camera to the next side of view.
protected  void nextSide(int side)
          Just put the camera to the given side of view.
protected  void setDestination(java.io.File file, MimeType mt)
           
protected abstract  void setRunLater()
          When a Billboard-Render-Thread is finished, the implementation of this method will be executed later.
static Matrix34d transformation(Node node, boolean post)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

angleOffset

protected double angleOffset

appendfix

protected java.lang.String appendfix

camera

protected RotationCamera camera

countZero

protected int countZero

currentSide

protected int currentSide

file

protected java.io.File file

imageFolder

protected java.lang.String imageFolder

imgHeight

protected int imgHeight

imgWidth

protected int imgWidth

mt

protected MimeType mt

MT_EXR

public static final MimeType MT_EXR
The MIME type image/exr without parameters.


MT_JPG

public static final MimeType MT_JPG
The MIME type image/jpeg without parameters.


MT_PJPG

public static final MimeType MT_PJPG
The MIME type image/pjpeg without parameters.


MT_PNG

public static final MimeType MT_PNG
The MIME type image/png without parameters.


MT_X_EXR

public static final MimeType MT_X_EXR
The MIME type image/x-exr without parameters.


pathAndFileName

protected java.lang.String pathAndFileName

prefix

protected java.lang.String prefix

RotationAngle

protected double RotationAngle

rotationPoint

protected TVector3d rotationPoint

sides

protected int sides

suffix

protected java.lang.String suffix

view3d

protected View3D view3d
Constructor Detail

Billboarder

public Billboarder()
Method Detail

angleOffset

public void angleOffset(int angleOffset)
Shift the camera after the rotation to the value angleOffset. This is helpful if you already got some rendered images of a model and you want to render the images between. Maybe you've got a 20-image billboard. So the RotationAngle is (360�/20 sides). And now you want 20 images more. You can take the half of the value RotationAngle from the last billboard-render. In this case RotationAngle/2 = 9�. But beware: you have to safe the images of your last render, cause the billboard starts to count at zero. This old images could be overwritten.

Parameters:
angleOffset -

beginAt

public void beginAt(int side)
The Billboarder starts at the given side. Attention: the first side has the number 0.

Parameters:
side -

billboarding

public void billboarding()
This method rendered each side of an object given in the view. The number of sides was set by invoke the initialize - method. After a render-step the camera will rotate and it will be start the next render-step.


finalAction

protected void finalAction()
This method is invoked after the last billboard was rendered.


getBBName

protected java.lang.String getBBName(int index)
This method return the path and filename of the billboard as an URI-String

Parameters:
index - Number of the rendered billboard
Returns:
Path and filename of the given billboard-number.

getLeadingZeros

protected java.lang.String getLeadingZeros(int limit,
                                           int position)
This generates a string with leading zeros. The number of "0" in the string depends on the log10 of a maximum number limit and a position. Its used by generating a filename with leading zeros. This is important to beware the order of the files, cause filenames are strings and not numbers. For 14 files you've got one leading 0: "bill_01.jpg, bill_02.jpg, ... bill_14.png

Parameters:
limit - For creation of the maximum number of zeros.
position - How much zeros are at a position.
Returns:
A string filled with "0".

graph

public static GraphManager graph()

initialize

public void initialize(double distance,
                       double zOfsset,
                       int sides)
This method has to be invoke before invoke .

Parameters:
distance - Distance between camera and the origin of the coordinates-system
zOfsset - The z-axis shift of the camera
sides - How much sides has to be rendered of the object.

insertName

protected void insertName(java.lang.String name)
Stores the name of a rendered billboard into an internal list.

Parameters:
name - Name of a billboard picture file.

justRenderView

public static void justRenderView(java.io.File file,
                                  MimeType mt)

location

public static Point3d location(Node node)

nextSide

protected void nextSide()
Just put the camera to the next side of view.


nextSide

protected void nextSide(int side)
Just put the camera to the given side of view.


setDestination

protected void setDestination(java.io.File file,
                              MimeType mt)
                       throws java.io.IOException
Throws:
java.io.IOException

setRunLater

protected abstract void setRunLater()
When a Billboard-Render-Thread is finished, the implementation of this method will be executed later.


transformation

public static Matrix34d transformation(Node node,
                                       boolean post)