|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.atzberger.mango.atz3d.Atz3D_Camera
public class Atz3D_Camera
Represents camera orientation and view for 3D rendering package.
The nomenclature associated with the camera model and projection operations follows the book
"Computer Graphics: Principles and Practice, Second Edition in C by Foley, van Dam, Feiner, and Hughes, Addison-Wesley, 1987.
For the particular definitions see the materials around pg. 237.
We summarise them here:
VRP = View reference point.
VPN = View plane normal
VRC = View reference coodinates
VUP = View up vector (note projected orthogonal to VPN)
DOP = Direction of projection
CW = Center of window
PRP = Projection reference point
winBounds = bounds (ell1, ell2) of the window screen in 2D real-space. (normalized window coordinates go from 0.0 to 1.0)
The internal canonical view used for calculations (after transformation) is oriented with the camera looking down the z-axis, so the view-plane is in the x-y-directions (right-handed coordinate system).
Field Summary | |
---|---|
double[] |
cameraCW
|
double[] |
cameraVPN
|
double[] |
cameraVRP
|
double[] |
cameraVUP
|
double[] |
cameraWinBounds
|
static int |
FILE_TYPE_XML
|
static int |
num_dim
|
static java.lang.String |
tagXML_Atz3D_Camera
|
static java.lang.String |
tagXML_cameraCW
|
static java.lang.String |
tagXML_cameraVPN
|
static java.lang.String |
tagXML_cameraVRP
|
static java.lang.String |
tagXML_cameraVUP
|
static java.lang.String |
tagXML_cameraWinBounds
|
Constructor Summary | |
---|---|
Atz3D_Camera()
Create the camera with a default view. |
Method Summary | |
---|---|
Atz3D_Camera |
clone()
Make a copy of the camera |
void |
exportData(java.lang.String filename,
int flagType)
Export the state of the camera to a data file. |
void |
exportToXML(java.io.BufferedWriter fid)
* Export the state of the camera to an XML data file. |
double[] |
genCameraRotationMatrix()
Generate the rotation matrix which converts from world coordinate frame to the camera canonical coordinate frame. |
void |
importData(java.lang.String filename,
int flagType)
Import the camera state from a data file |
void |
setCameraView(double[] new_cameraVRP,
double[] new_cameraVUP,
double[] new_cameraVPN,
double[] new_cameraCW,
double[] new_cameraWinBounds)
Set the camera view explicitly |
void |
setDefaultValues()
Set the default values for the camera view. |
void |
transformPts_2D_To_Screen(double[] ptsX_2D,
java.awt.Dimension screenSize,
double[] ptsX_Screen_transformed)
Use the camera settings to find scaling to screen size |
void |
transformPts_2D_To_Screen(double[] ptsX_2D,
double[] ptsX_Screen_transformed)
Transform the 3D model to a 2D view suitable for rendering on screen. |
void |
transformPts_3D_To_2D(double[] ptsX_3D,
double[] ptsX_2D)
Transforms the 3D points to corresponding points in the view plane. |
void |
XML_characters(char[] ch,
int start,
int length,
Atz_XML_SAX_DataHandler sourceHandler)
Collect misc. |
void |
XML_endDocument(Atz_XML_SAX_DataHandler sourceHandler)
Perform these operations when done parsing an XML file. |
void |
XML_endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
Atz_XML_SAX_DataHandler sourceHandler)
Perform these operations when encountering the end of an XML tag region. |
java.lang.Object |
XML_getData()
Get data associated with the XML parsing just performed. |
void |
XML_startDocument(Atz_XML_SAX_DataHandler sourceHandler)
Perform these operations when starting to parse the XML file. |
void |
XML_startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes,
Atz_XML_SAX_DataHandler sourceHandler)
Perform this operation when starting to parse an XML tag. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int num_dim
public double[] cameraVUP
public double[] cameraVRP
public double[] cameraVPN
public double[] cameraCW
public double[] cameraWinBounds
public static final int FILE_TYPE_XML
public static java.lang.String tagXML_Atz3D_Camera
public static java.lang.String tagXML_cameraVUP
public static java.lang.String tagXML_cameraVRP
public static java.lang.String tagXML_cameraVPN
public static java.lang.String tagXML_cameraCW
public static java.lang.String tagXML_cameraWinBounds
Constructor Detail |
---|
public Atz3D_Camera()
Method Detail |
---|
public void setDefaultValues()
public Atz3D_Camera clone()
clone
in class java.lang.Object
public void setCameraView(double[] new_cameraVRP, double[] new_cameraVUP, double[] new_cameraVPN, double[] new_cameraCW, double[] new_cameraWinBounds)
new_cameraVRP
- new_cameraVUP
- new_cameraVPN
- new_cameraCW
- new_cameraWinBounds
- public void transformPts_3D_To_2D(double[] ptsX_3D, double[] ptsX_2D)
public void transformPts_2D_To_Screen(double[] ptsX_2D, double[] ptsX_Screen_transformed)
public void transformPts_2D_To_Screen(double[] ptsX_2D, java.awt.Dimension screenSize, double[] ptsX_Screen_transformed)
public double[] genCameraRotationMatrix()
public void exportData(java.lang.String filename, int flagType)
filename
- flagType
- public void exportToXML(java.io.BufferedWriter fid)
exportToXML
in interface Atz_XML_Writeable
fid
- public void importData(java.lang.String filename, int flagType)
filename
- flagType
- public void XML_startDocument(Atz_XML_SAX_DataHandler sourceHandler)
XML_startDocument
in interface Atz_XML_SAX_DataHandlerInterface
sourceHandler
- public void XML_endDocument(Atz_XML_SAX_DataHandler sourceHandler)
XML_endDocument
in interface Atz_XML_SAX_DataHandlerInterface
sourceHandler
- public void XML_startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes, Atz_XML_SAX_DataHandler sourceHandler) throws org.xml.sax.SAXException
XML_startElement
in interface Atz_XML_SAX_DataHandlerInterface
uri
- localName
- qName
- attributes
- sourceHandler
-
org.xml.sax.SAXException
public void XML_characters(char[] ch, int start, int length, Atz_XML_SAX_DataHandler sourceHandler) throws org.xml.sax.SAXException
XML_characters
in interface Atz_XML_SAX_DataHandlerInterface
ch
- start
- length
- sourceHandler
-
org.xml.sax.SAXException
public void XML_endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, Atz_XML_SAX_DataHandler sourceHandler) throws org.xml.sax.SAXException
XML_endElement
in interface Atz_XML_SAX_DataHandlerInterface
uri
- localName
- qName
- sourceHandler
-
org.xml.sax.SAXException
public java.lang.Object XML_getData()
XML_getData
in interface Atz_XML_SAX_DataHandlerInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |