anar

Class Camera

java.lang.Object
  extended by anar.Parametric
      extended by anar.Pts
          extended by anar.Camera
All Implemented Interfaces:
iTaggable, iTransformable

public class Camera
extends Pts

New Camera. Based on two points (target and camera position). Could be moved like other objects. (Transform, Translate ....)


Field Summary
 float damp
           
static float defaultMinimalDistanceIsOver
           
 Param FOV
           
static PApplet p5
           
 Param rx
           
 Param rz
           
 Param sc
           
 
Fields inherited from class anar.Pts
globalRender, meta, ptList, render
 
Constructor Summary
Camera(Camera c)
           
Camera(float cameraX, float cameraY, float cameraZ, float targetX, float targetY, float targetZ)
           
Camera(Pt camera)
           
Camera(Pt camera, Pt target)
           
Camera(Pt camera, Pt target, Pt horizon)
           
 
Method Summary
 void feed()
           
 Pt getCamera()
           
 Pt getTarget()
           
 boolean isFovInTransition()
          Test is FOV is in transition.
 boolean isOver(XYZ pt)
          Test if the mouse is over this coordinate.
 boolean isOver(XYZ pt, float dist)
          Test if the mouse is over this coordinate.
 void match(Camera newCamera)
           
 Vertex onScreen(XYZ p)
          Projection of a 3D point on the 2D screen.
 void orientedDrawBegin()
           
 void orientedDrawBegin(XYZ q)
          Orient the Z axis facing the camera and translate.
 void orientedDrawEnd()
           
 void ortho()
           
 void screenDrawBegin()
           
 void screenDrawEnd()
           
 void setCamera(float x, float y, float z)
           
 void setCamera(Pt camera)
          Set camera, not tested yet.
 void setCamera(PtABS camera)
           
 void setHorizon(float x, float y, float z)
           
 void setHorizon(PtABS camera)
           
 void setTarget(float x, float y, float z)
           
 void setTarget(Pt target)
          Set target, not tested yet.
 void setTarget(PtABS target)
           
static void text(java.lang.String str, XYZ position)
           
static void text3D(java.lang.String str, XYZ position)
           
 java.lang.String toPovRay()
           
 java.lang.String toRadiance()
           
 void unortho()
           
 float zNear()
           
 
Methods inherited from class anar.Pts
add, add, add, add, add, add, add, add, addPointsFrom, apply, area, area, bound, boundCenter, color, color, color, color, color, copy, discretization, draw, drawPoints, flip, get, getPt, inLine, iterator, length, numOfPts, orphaned, pt, ptEnd, ptEnd, ptMod, ptOnCurve, remove, remove, render, render, reverse, rotateX, rotateX, rotateY, rotateY, rotateZ, rotateZ, scale, scale, scale, scale, scale, scale, scale, scale, scaleX, scaleX, scaleY, scaleY, scaleZ, scaleZ, set, set, setMeta, size, stroke, stroke, stroke, stroke, stroke, tag, tag, toANSYS, toAutocad, toMegaPOVLink, toObjExporter, toObjExporter, toPovRayAsArray, toPovRayAsCylinder, toRadianceAsCylinder, toRhino, toRhinoAsObject, toSketchUp, toString, translate, translate, translate, translate, translate, translate, translateX, translateX, translateY, translateY, translateZ, translateZ
 
Methods inherited from class anar.Parametric
child, getMeta, getPrimitive, parent, parent, parentList, parentList, parentList, parentListGraphViz, parentListGraphViz, parentListRecursive, parentListRecursiveGraphViz, parentToString, parentToStringRecursive, parentToStringRecursive, primitiveToString, replaceParent, replaceParent, replicate, tag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p5

public static PApplet p5

sc

public Param sc

rx

public Param rx

rz

public Param rz

FOV

public Param FOV

defaultMinimalDistanceIsOver

public static float defaultMinimalDistanceIsOver

damp

public float damp
Constructor Detail

Camera

public Camera(float cameraX,
              float cameraY,
              float cameraZ,
              float targetX,
              float targetY,
              float targetZ)

Camera

public Camera(Pt camera)

Camera

public Camera(Pt camera,
              Pt target)

Camera

public Camera(Pt camera,
              Pt target,
              Pt horizon)

Camera

public Camera(Camera c)
Method Detail

setCamera

public void setCamera(Pt camera)
Set camera, not tested yet.

Parameters:
camera - the camera to set

getCamera

public Pt getCamera()
Returns:
the camera

setTarget

public void setTarget(Pt target)
Set target, not tested yet.

Parameters:
target - the target to set

getTarget

public Pt getTarget()
Returns:
the target

toPovRay

public java.lang.String toPovRay()

toRadiance

public java.lang.String toRadiance()

zNear

public float zNear()

onScreen

public Vertex onScreen(XYZ p)
Projection of a 3D point on the 2D screen.

Parameters:
p -
Returns:

isOver

public boolean isOver(XYZ pt)
Test if the mouse is over this coordinate.

Parameters:
pt -
Returns:

isOver

public boolean isOver(XYZ pt,
                      float dist)
Test if the mouse is over this coordinate.

Parameters:
pt -
Returns:

feed

public void feed()

match

public void match(Camera newCamera)
Parameters:
newCamera -

setTarget

public void setTarget(float x,
                      float y,
                      float z)

setTarget

public void setTarget(PtABS target)

setCamera

public void setCamera(float x,
                      float y,
                      float z)

setCamera

public void setCamera(PtABS camera)

setHorizon

public void setHorizon(float x,
                       float y,
                       float z)

setHorizon

public void setHorizon(PtABS camera)

ortho

public void ortho()

unortho

public void unortho()

isFovInTransition

public boolean isFovInTransition()
Test is FOV is in transition.

Returns:

screenDrawBegin

public void screenDrawBegin()

screenDrawEnd

public void screenDrawEnd()

orientedDrawBegin

public void orientedDrawBegin(XYZ q)
Orient the Z axis facing the camera and translate.

Parameters:
q - - Translation to point

orientedDrawBegin

public void orientedDrawBegin()

orientedDrawEnd

public void orientedDrawEnd()

text3D

public static void text3D(java.lang.String str,
                          XYZ position)

text

public static void text(java.lang.String str,
                        XYZ position)