decided to rename 'atransform' back to 'transform'. added renderings by Geoffrey Irving to demonstrate the instance plugin (with permission)

metadata
Wenzel Jakob 2013-01-28 19:56:45 -05:00
parent ddde0f655c
commit 511568c846
30 changed files with 54 additions and 44 deletions

View File

@ -292,7 +292,7 @@ and \emph{animated transformations} as parameters. The latter is useful to
render scenes involving motion blur. The syntax used to specify these
is slightly different:
\begin{xml}
<atransform name="trafoProperty">
<animation name="trafoProperty">
<transform time="0">
.. chained list of transformations as discussed above ..
</transform>
@ -302,7 +302,7 @@ is slightly different:
</transform>
.. additional transformations (optional) ..
</atransform>
</animation>
\end{xml}
Mitsuba then decomposes each transformation into a scale, translation, and
rotation component and interpolates\footnote{Using linear interpolation

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -31,7 +31,7 @@
\newcommand{\order}[1]{} % Ignore
\newcommand{\Transform}{\texttt{transform}}
\newcommand{\ATransform}{\texttt{atransform}}
\newcommand{\Animation}{\texttt{animation}}
\newcommand{\Spectrum}{\texttt{spectrum}}
\newcommand{\Integer}{\texttt{integer}}
\newcommand{\String}{\texttt{string}}

View File

@ -116,7 +116,7 @@
medium,film,sampler,integrator,emitter,sensor,
translate,rotate,scale,lookat,point,vector,matrix,
include,fscat,volume,alias,rfilter,boolean,
subsurface,atransform
subsurface,animation
},
}

View File

@ -158,7 +158,7 @@ private:
EBoolean, EString, ETranslate, ERotate,
ELookAt, EScale, EMatrix, EPoint,
EVector, ERGB, ESRGB, EBlackBody,
ESpectrum, ETransform, EATransform,
ESpectrum, ETransform, EAnimation,
EInclude, EAlias
};

View File

@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN
* \icon{emitter_collimated}
* \order{5}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional emitter-to-world transformation.
* \default{none (i.e. emitter space $=$ world space)}
* }

View File

@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN
* \icon{emitter_directional}
* \order{4}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional emitter-to-world transformation.
* \default{none (i.e. emitter space $=$ world space)}
* }

View File

@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN
* \icon{emitter_point}
* \order{1}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional sensor-to-world transformation.
* \default{none (i.e. sensor space $=$ world space)}
* }

View File

@ -71,7 +71,7 @@ MTS_NAMESPACE_BEGIN
* Specifies the relative amount of samples
* allocated to this emitter. \default{1}
* }
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional sensor-to-world transformation.
* \default{none (i.e. sensor space $=$ world space)}
* }

View File

@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN
* \icon{emitter_spot}
* \order{3}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional sensor-to-world transformation.
* \default{none (i.e. sensor space $=$ world space)}
* }

View File

@ -100,7 +100,7 @@ ref<const AnimatedTransform> Properties::getAnimatedTransform(const std::string
const Transform *result2 = boost::get<Transform>(&it->second.data);
if (!result1 && !result2)
SLog(EError, "The property \"%s\" has the wrong type (expected <atransform> or <transform>). The "
SLog(EError, "The property \"%s\" has the wrong type (expected <animation> or <transform>). The "
"complete property record is :\n%s", name.c_str(), toString().c_str());
it->second.queried = true;
@ -118,7 +118,7 @@ ref<const AnimatedTransform> Properties::getAnimatedTransform(const std::string
const Transform *result2 = boost::get<Transform>(&it->second.data);
if (!result1 && !result2)
SLog(EError, "The property \"%s\" has the wrong type (expected <atransform> or <transform>). The "
SLog(EError, "The property \"%s\" has the wrong type (expected <animation> or <transform>). The "
"complete property record is :\n%s", name.c_str(), toString().c_str());
it->second.queried = true;
@ -138,7 +138,7 @@ ref<const AnimatedTransform> Properties::getAnimatedTransform(const std::string
const Transform *result2 = boost::get<Transform>(&it->second.data);
if (!result1 && !result2)
SLog(EError, "The property \"%s\" has the wrong type (expected <atransform> or <transform>). The "
SLog(EError, "The property \"%s\" has the wrong type (expected <animation> or <transform>). The "
"complete property record is :\n%s", name.c_str(), toString().c_str());
it->second.queried = true;

View File

@ -103,7 +103,7 @@ SceneHandler::SceneHandler(const SAXParser *parser,
m_tags["blackbody"] = TagEntry(EBlackBody, (Class *) NULL);
m_tags["spectrum"] = TagEntry(ESpectrum, (Class *) NULL);
m_tags["transform"] = TagEntry(ETransform, (Class *) NULL);
m_tags["atransform"] = TagEntry(EATransform, (Class *) NULL);
m_tags["animation"] = TagEntry(EAnimation, (Class *) NULL);
m_tags["include"] = TagEntry(EInclude, (Class *) NULL);
m_tags["alias"] = TagEntry(EAlias, (Class *) NULL);
@ -254,7 +254,7 @@ void SceneHandler::startElement(const XMLCh* const xmlName,
case ETransform:
m_transform = Transform();
break;
case EATransform: {
case EAnimation: {
m_animatedTransform = new AnimatedTransform();
ref<VectorTrack> translation = new VectorTrack(VectorTrack::ETranslationXYZ);
ref<QuatTrack> rotation = new QuatTrack(VectorTrack::ERotationQuat);
@ -606,7 +606,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) {
}
break;
case EATransform: {
case EAnimation: {
m_animatedTransform->sortAndSimplify();
context.parent->properties.setAnimatedTransform(
context.attributes["name"], m_animatedTransform);

View File

@ -84,7 +84,7 @@ static void setProperties(QDomDocument &doc, QDomElement &element,
std::set<Float> times;
trafo->collectKeyframes(times);
property = doc.createElement("atransform");
property = doc.createElement("animation");
for (std::set<Float>::iterator it2 = times.begin(); it2 != times.end(); ++it2) {
const Matrix4x4 &matrix = trafo->eval(*it2).getMatrix();

View File

@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{fluencemeter}{Fluence meter}
* \order{7}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional sensor-to-world transformation.
* \default{none (i.e. sensor space $=$ world space)}
* }

View File

@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{orthographic}{Orthographic camera}
* \order{3}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional camera-to-world transformation.
* \default{none (i.e. camera space $=$ world space)}
* }

View File

@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{perspective}{Perspective pinhole camera}
* \order{1}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional camera-to-world transformation.
* \default{none (i.e. camera space $=$ world space)}
* }

View File

@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{radiancemeter}{Radiance meter}
* \order{6}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional sensor-to-world transformation.
* \default{none (i.e. sensor space $=$ world space)}
* }

View File

@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{spherical}{Spherical camera}
* \order{5}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional camera-to-world transformation.
* \default{none (i.e. camera space $=$ world space)}
* }

View File

@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{telecentric}{Telecentric lens camera}
* \order{4}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional sensor-to-world transformation.
* \default{none (i.e. camera space $=$ world space)}
* }

View File

@ -29,7 +29,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{thinlens}{Perspective camera with a thin lens}
* \order{2}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional camera-to-world transformation.
* \default{none (i.e. camera space $=$ world space)}
* }

View File

@ -43,7 +43,7 @@ MTS_NAMESPACE_BEGIN
* Is the cylinder inverted, i.e. should the normal vectors
* be flipped? \default{\code{false}, i.e. the normals point outside}
* }
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear object-to-world transformation.
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}

View File

@ -31,7 +31,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{disk}{Disk intersection primitive}
* \order{4}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies a linear object-to-world transformation.
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}

View File

@ -25,15 +25,33 @@ MTS_NAMESPACE_BEGIN
* \parameters{
* \parameter{\Unnamed}{\ShapeGroup}{A reference to a
* shape group that should be instantiated}
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear instance-to-world transformation.
* \default{none (i.e. instance space $=$ world space)}
* }
* }
* \renderings{
* \rendering{Surface viewed from the top}{shape_instance_fractal_top}
* \rendering{Surface viewed from the bottom}{shape_instance_fractal_bot}
* \caption{
* A visualization of a fractal surface by Irving and Segerman.
* (a 2D Gospel curve developed up to level 5 along the third
* dimension). This scene makes use of instancing to replicate
* similar structures to cheaply render a structure that effectively
* consists of several hundred millions of triangles.
* }
* }
*
* This plugin implements a geometry instance used to efficiently replicate
* geometry many times. For details, please refer to the \pluginref{shapegroup}
* plugin.
* geometry many times. For details on how to create instances, refer to
* the \pluginref{shapegroup} plugin.
* \remarks{
* \item Note that it is \emph{not} possible to assign a different
* material to each instance --- the material assignment specified within
* the shape group is the one that matters.
* \item Shape groups cannot be used to replicate shapes with
* attached emitters, sensors, or subsurface scattering models.
* }
*/
Instance::Instance(const Properties &props) : Shape(props) {

View File

@ -55,7 +55,7 @@ MTS_NAMESPACE_BEGIN
* this convention. \default{\code{true}, i.e. flip them to get the
* correct coordinates}.
* }
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear object-to-world transformation.
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}

View File

@ -62,7 +62,7 @@ MTS_NAMESPACE_BEGIN
* Optional flag to flip all normals. \default{\code{false}, i.e.
* the normals are left unchanged}.
* }
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear object-to-world transformation.
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}

View File

@ -30,7 +30,7 @@ MTS_NAMESPACE_BEGIN
/*!\plugin{rectangle}{Rectangle intersection primitive}
* \order{3}
* \parameters{
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies a linear object-to-world transformation.
* It is allowed to use non-uniform scaling, but no shear.
* \default{none (i.e. object space $=$ world space)}

View File

@ -55,7 +55,7 @@ MTS_NAMESPACE_BEGIN
* Optional flag to flip all normals. \default{\code{false}, i.e.
* the normals are left unchanged}.
* }
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear object-to-world transformation.
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}

View File

@ -34,9 +34,9 @@ MTS_NAMESPACE_BEGIN
* so that they can efficiently be referenced many times using the
* \pluginref{instance} plugin. This is useful for rendering things like
* forests, where only a few distinct types of trees have to be kept
* in memory.
* in memory. An example is given below:
*
* \vspace{5mm}
* \begin{xml}[caption={An example of geometry instancing}, label=lst:instancing]
* <!-- Declare a named shape group containing two objects -->
* <shape type="shapegroup" id="myShapeGroup">
@ -68,14 +68,6 @@ MTS_NAMESPACE_BEGIN
* </transform>
* </shape>
* \end{xml}
* \vspace{-2mm}
* \remarks{
* \item Note that it is not possible to assign a different
* material to each instance --- the material assignment specified within
* the shape group is the one that matters.
* \item Shape groups can not be used to replicate shapes with
* attached emitters, sensors, or subsurface scattering models.
* }
*/
ShapeGroup::ShapeGroup(const Properties &props) : Shape(props) {

View File

@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN
* \parameter{radius}{\Float}{
* Radius of the sphere in object-space units \default{1}
* }
* \parameter{toWorld}{\Transform\Or\ATransform}{
* \parameter{toWorld}{\Transform\Or\Animation}{
* Specifies an optional linear object-to-world transformation.
* Note that non-uniform scales are not permitted!
* \default{none (i.e. object space $=$ world space)}