Detailed Description
- See also:
- Class MtlBase,
Class ShadeContext, Class Point3.
- Description:
- This class generates Point3 coordinates based on the
ShadeContext. A reference to one
of these is referenced by all 3D texture maps. XYZGen does for 3D Texmaps what
UVGen does for
2D Texmaps. It puts up the 3D "Coordinates" rollup, and supplies
the 3D Texmap with
transformed 3D coordinates. All methods of this class are
implemented by the system.
#include <imtl.h>
List of all
members.
Member Function Documentation
- Parameters:
- ShadeContext& sc
Describes the properties of the point to be shaded.
Point3&
p
The 3D point is returned here.
Point3&
dp
The derivative of the 3D point is returned here.
SClass_ID SuperClassID |
( |
|
) |
[inline, virtual] |
Retrieves a constant representing the type of the plugin.
- Returns:
- A super class id that uniquely identifies the type (category)
of the plugin. Note that several plugin classes can be of the same
type, thus return the same super class id. Plugins are uniquely
identified by their class ids. List of Super Class
IDs.
- See also:
- SClass_ID
Reimplemented from ReferenceTarget.
virtual void SetRollupOpen |
( |
BOOL |
open |
) |
[pure virtual] |
- Parameters:
- BOOL open
TRUE for open; FALSE for closed.
virtual BOOL GetRollupOpen |
( |
|
) |
[pure virtual] |
- Returns:
- TRUE is open; FALSE is closed.
virtual BOOL IsStdXYZGen |
( |
|
) |
[inline, virtual] |
- Parameters:
- ShadeContext& sc
Describes the properties of the point to be shaded.
Point3* dP
The 3 unit vectors for computing differentials are returned
here.
- Default Implementation:
- {}
- Sample Code:
- Here is a typical use of XYZGen->GetBumpDP()
to compute the bump mapping for a 3D texture:
Point3 Marble::EvalNormalPerturb(ShadeContext& sc) {
float del,d;
Point3 p,dp;
if (!sc.doMaps)
return Point3(0,0,0);
if (gbufID)
sc.SetGBufferID(gbufID);
xyzGen->GetXYZ(sc,p,dp);
if (size==0.0f)
size=.0001f;
p *= FACT/size;
d = MarbleFunc(p);
del = 20.0f;
Point3 np;
Point3 M[3];
xyzGen->GetBumpDP(sc,M);
np.x = (MarbleFunc(p+del*M[0]) - d)/del;
np.y = (MarbleFunc(p+del*M[1]) - d)/del;
np.z = (MarbleFunc(p+del*M[2]) - d)/del;
np *= 100.0f;
return sc.VectorFrom(np,REF_OBJECT);
}
- Parameters:
-
gom |
Points to the schematic view window manager. |
gNode |
Points to this node in the schematic view. |
isBeingEdited |
TRUE if the item is being edited; FALSE if not. |
- Default Implementation:
-
{
Animatable *owner;
int subNum;
MSTR name;
owner = gNode->GetOwner();
subNum = gNode->GetID();
name = owner->SubAnimName(subNum);
return name;
}
Reimplemented from MtlBase.