common
Class MappingShape

Object
  extended by common:Generic
      extended by common:MappingShape
Direct Known Subclasses:
Standard_MappingShapeEgg, Standard_MappingShapePlane, Standard_MappingShapeSphere

class 
Generic:MappingShape

MappingShape base class.

MappingShape represents a shape in 3D space with a texture (usually a fractal) mapped on it. It provides the GetTextureCoordinates function which can be called to obtain the intersection point of the shape and a given line, and the texture coordinates at that point.

MappingShape uses the left-handed coordinate system, where X points to the right, Y points up, and Z points into the screen. To determine the direction of a rotation, hold your left hand such that your thumb points into the direction of the axis around which the rotation takes place, and then your curled fingers point into the direction of positive rotation.


Ultra Fractal Source

Toggle UF Source Code Display

 class MappingShape(Generic) {
   ; MappingShape base class.
   ; <p>
   ; MappingShape represents a shape in 3D space with a texture (usually a
   ; fractal) mapped on it. It provides the GetTextureCoordinates function which
   ; can be called to obtain the intersection point of the shape and a given line,
   ; and the texture coordinates at that point.
   ; <p>
   ; MappingShape uses the left-handed coordinate system, where X points to the
   ; right, Y points up, and Z points into the screen. To determine the direction
   ; of a rotation, hold your left hand such that your thumb points into the
   ; direction of the axis around which the rotation takes place, and then your
   ; curled fingers point into the direction of positive rotation.
 
 public:
   ; GetTextureCoordinates tests a ray against the mapping shape. If the ray
   ; intersects the shape, it returns true, and returns the coordinates of the
   ; point on the shape that intersects the ray in the result argument. If the
   ; shape does not intersect the ray, returns false.
   ; <p>
   ; A concrete shape descendant should override this function to define the
   ; mapping shape.
   ; <p>
   ; The ray is defined as:<br>
   ; [ sx ]          [ dx ]<br>
   ; [ sy ] + lambda [ dy ]<br>
   ; [ sz ]          [ dz ]
   ;
   ; @param sx X coordinate of point in space that the ray passes through.
   ; @param sy Y coordinate of point in space that the ray passes through.
   ; @param sz Z coordinate of point in space that the ray passes through.
   ; @param dx Relative movement of the line along the X axis.
   ; @param dy Relative movement of the line along the Y axis.
   ; @param dz Relative movement of the line along the Z axis.
   ; @param result Receives the texture coordinates if the function returns true.
   ; @return True if the ray intersects the shape, false otherwise.
   bool func GetTextureCoordinates(float sx, float sy, float sz, float dx, \
                   float dy, float dz, complex &result)
     return false
   endfunc
 
 default:
   int param v_mappingshape
     caption = "Version (MappingShape)"
     default = 100
     hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
     visible = @v_mappingshape < 100
   endparam
 }
 


Constructor Summary
MappingShape()
           
 
Method Summary
 boolean GetTextureCoordinates(float sx, float sy, float sz, float dx, float dy, float dz, complex result)
          GetTextureCoordinates tests a ray against the mapping shape.
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

MappingShape

public MappingShape()
Method Detail

GetTextureCoordinates

public boolean GetTextureCoordinates(float sx,
                                     float sy,
                                     float sz,
                                     float dx,
                                     float dy,
                                     float dz,
                                     complex result)
GetTextureCoordinates tests a ray against the mapping shape. If the ray intersects the shape, it returns true, and returns the coordinates of the point on the shape that intersects the ray in the result argument. If the shape does not intersect the ray, returns false.

A concrete shape descendant should override this function to define the mapping shape.

The ray is defined as:
[ sx ] [ dx ]
[ sy ] + lambda [ dy ]
[ sz ] [ dz ]

Parameters:
sx - X coordinate of point in space that the ray passes through.
sy - Y coordinate of point in space that the ray passes through.
sz - Z coordinate of point in space that the ray passes through.
dx - Relative movement of the line along the X axis.
dy - Relative movement of the line along the Y axis.
dz - Relative movement of the line along the Z axis.
result - Receives the texture coordinates if the function returns true.
Returns:
True if the ray intersects the shape, false otherwise.