r3surf
real/raytr/r3surf.h
r3raytr
Surface Class
r3Frsurface
R3CLID_FRSURFACE
r3Surface
R3CLID_SURFACE - 406
RAYHIT, RAYHITOPT, RAYHITOPTM, AXHITOPT, LIGHTHIT, LIGHTHITOPT, LIGHTHITOPTM, TRIM, AXTRIM, ORIGTRIM, EVALUATESURFACEPOINT, EVALUATEUV, QUERYPOSDATA, QUERYAXDATA, QUERYSHADOWDATA, INITPOSDATA, INITAXDATA, INITSHADOWDATA, REGISTERCACHECLASS, CREATECACHE, DELETECACHE, RESETCACHE, ALLOCCACHE, FREECACHE, INITCACHE, GETHOLLOWNESS, INCREASECACHE, EVALUATEDERIVATE, NOSHADOWS, GETEXTFLAGS, SETEXTFLAGS,
Radius, Mask, MaskPoints, Cog, Parent, Trim, InvertUVTrim, TrimOperation, InvertNormal, Complexity,
int R3RegisterSurfClass(R3APP *app);
R3SURFM_RAYHIT
RAYHIT
R3SURFM_RAYHIT
obj.RAYHIT();
General rayhit finder. Ray position & direction can be arbitrary.
R3SURFM_RAYHITOPT
RAYHITOPT
R3SURFM_RAYHITOPT
obj.RAYHITOPT();
Perspective camera rayhit finder (ray source position = (0,0,0)). * Only hits greater than RHITMSG->mindist are accepted.
R3SURFM_RAYHITOPTM
RAYHITOPTM
R3SURFM_RAYHITOPTM
obj.RAYHITOPTM();
Same as above, but this method is called if the surface is known to be fully in front of the camera.
R3SURFM_AXHITOPT
AXHITOPT
R3SURFM_AXHITOPT
obj.AXHITOPT();
Parallel camera rayhit finder (ray dir = (0,0,1), ray source = (x,y,0) ). * Only hits greater than RHITMSG->mindist are accepted.
R3SURFM_LIGHTHIT
LIGHTHIT
R3SURFM_LIGHTHIT
obj.LIGHTHIT();
general light ray finder. * All hits closer than RHITMSG->nrsthit->dist should be processed.
R3SURFM_LIGHTHITOPT
LIGHTHITOPT
R3SURFM_LIGHTHITOPT
obj.LIGHTHITOPT();
light rayhit finder (all light rays originate from the same position). * All hits closer than RHITMSG->nrsthit->dist should be processed.
R3SURFM_LIGHTHITOPTM
LIGHTHITOPTM
R3SURFM_LIGHTHITOPTM
obj.LIGHTHITOPTM();
Same as above, but this method is called if the surface is known to be fully in front of the light ray origin at the direction of the given ray (e.g. when the ray is cast by an optimized spot light).
R3SURFM_TRIM
TRIM
R3SURFM_TRIM
obj.TRIM();
R3SURFM_AXTRIM
AXTRIM
R3SURFM_AXTRIM
obj.AXTRIM();
R3SURFM_ORIGTRIM
ORIGTRIM
R3SURFM_ORIGTRIM
obj.ORIGTRIM();
R3SURFM_EVALUATESURFACEPOINT
EVALUATESURFACEPOINT
R3SURFM_EVALUATESURFACEPOINT
obj.EVALUATESURFACEPOINT();
Evaluates properties in a point on the surface
R3SURFM_EVALUATEUV
EVALUATEUV
R3SURFM_EVALUATEUV
R3VECTOR, result UV coords
obj.EVALUATEUV(p3);
Evaluate only UV channel
R3SURFM_QUERYPOSDATA
QUERYPOSDATA
R3SURFM_QUERYPOSDATA
void*, pointer to a temp memory buffer (size = R3SURFCA_MaxPosdatasize defined by this class). * Store temporary values here to avoid time consuming recomputation later at ALLOCPOSDATA
R3TAG*, tag list includes R3SURFA_OptDataVector vector tag defining
obj.QUERYPOSDATA(0, p2, p3);
Surface visibility check for perspective camera rays from origin. Note that ray * tracer optimizes bounding sphere, bounding box etc. visibility so only very object specific * visibility properties should be optimized here.
R3SURFM_QUERYAXDATA
QUERYAXDATA
R3SURFM_QUERYAXDATA
obj.QUERYAXDATA();
R3SURFM_QUERYSHADOWDATA
QUERYSHADOWDATA
R3SURFM_QUERYSHADOWDATA
obj.QUERYSHADOWDATA();
R3SURFM_INITPOSDATA
INITPOSDATA
R3SURFM_INITPOSDATA
obj.INITPOSDATA();
Initialize optimization data for perspective camera ray hits p1: void *, the temp memory buffer that was available as p2 parameyter in R3SURFM_QUERYPOSDATA p2: R3POSDATA *, the optimization data to be initialized. You can put temporary values that depend on the surface and ray hit source position here to avoid repeating computation at rendering time. Rc: geometrical complexity estimate- see defs below
R3SURFM_INITAXDATA
INITAXDATA
R3SURFM_INITAXDATA
obj.INITAXDATA();
R3SURFM_INITSHADOWDATA
INITSHADOWDATA
R3SURFM_INITSHADOWDATA
obj.INITSHADOWDATA();
R3SURFCM_REGISTERCACHECLASS
REGISTERCACHECLASS
R3SURFCM_REGISTERCACHECLASS
obj.REGISTERCACHECLASS();
R3SURFCM_CREATECACHE
CREATECACHE
R3SURFCM_CREATECACHE
obj.CREATECACHE();
R3SURFCM_DELETECACHE
DELETECACHE
R3SURFCM_DELETECACHE
obj.DELETECACHE();
R3SURFCM_RESETCACHE
RESETCACHE
R3SURFCM_RESETCACHE
obj.RESETCACHE();
R3SURFCM_ALLOCCACHE
ALLOCCACHE
R3SURFCM_ALLOCCACHE
obj.ALLOCCACHE();
R3SURFCM_FREECACHE
FREECACHE
R3SURFCM_FREECACHE
obj.FREECACHE();
R3SURFCM_INITCACHE
INITCACHE
R3SURFCM_INITCACHE
obj.INITCACHE();
R3SURFM_GETHOLLOWNESS
GETHOLLOWNESS
R3SURFM_GETHOLLOWNESS
obj.GETHOLLOWNESS();
R3SURFCM_INCREASECACHE
INCREASECACHE
R3SURFCM_INCREASECACHE
obj.INCREASECACHE();
Increases cache counter so that next time when cache is needed, it is recreated to * take account the new situation. Example: When a new max point count is detected in CREATE method, * class sends this message to surface base class.
R3SURFM_EVALUATEDERIVATE
EVALUATEDERIVATE
R3SURFM_EVALUATEDERIVATE
R3OBJ*, u direction raysample initialized by R3SURFM_EVALUATESURFACEPOINT
R3OBJ*, v direction raysample initialized by R3SURFM_EVALUATESURFACEPOINT
obj.EVALUATEDERIVATE(0, p2, p3);
Evaluates properties in two near points of the ray hit point. * R3SURFM_EVALUATESURFACEPOINT is always called before use of this method.
R3SURFM_NOSHADOWS
NOSHADOWS
R3SURFM_NOSHADOWS
obj.NOSHADOWS();
R3SURFM_GETEXTFLAGS
GETEXTFLAGS
R3SURFM_GETEXTFLAGS
obj.GETEXTFLAGS();
R3SURFM_SETEXTFLAGS
SETEXTFLAGS
R3SURFM_SETEXTFLAGS
obj.SETEXTFLAGS();
Radius
Radius
R3SURFA_Radius
Number
R3FLOAT
bounding radius. Set to 0 for infinite surfaces
jsobj.SetRadius(value);
value = jsobj.GetRadius();
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SURFA_Radius, value, R3TAG_END);
R3FLOAT value;
R3GetAttrs(r3obj, R3SURFA_Radius, &value, R3TAG_END);
Mask
Mask
R3SURFA_Mask
array of mask points
jsobj.SetMask(value);
value = jsobj.GetMask();
R3VECTOR* value = ...;
R3SetAttrs(r3obj, R3SURFA_Mask, value, R3TAG_END);
R3VECTOR* value;
R3GetAttrs(r3obj, R3SURFA_Mask, &value, R3TAG_END);
MaskPoints
MaskPoints
R3SURFA_MaskPoints
Integer
R3INT
mask point count
jsobj.SetMaskPoints(value);
value = jsobj.GetMaskPoints();
R3INT value = ...;
R3SetAttrs(r3obj, R3SURFA_MaskPoints, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3SURFA_MaskPoints, &value, R3TAG_END);
Cog
Cog
R3SURFA_Cog
middle point. R3SURFA_Cog + R3SURFA_Radius define bounding sphere
value = jsobj.GetCog();
R3VECTOR value;
R3GetAttrs(r3obj, R3SURFA_Cog, &value, R3TAG_END);
Parent
Parent
R3SURFA_Parent
Object
R3OBJ*
Internal use
jsobj.SetParent(value);
value = jsobj.GetParent();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3SURFA_Parent, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3SURFA_Parent, &value, R3TAG_END);
Trim
Trim
R3SURFA_Trim
Object
R3OBJ*
Addres of a hierarchical 3D trim object linked to the surface
jsobj.SetTrim(value);
value = jsobj.GetTrim();
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3SURFA_Trim, value, R3TAG_END);
R3OBJ* value;
R3GetAttrs(r3obj, R3SURFA_Trim, &value, R3TAG_END);
InvertUVTrim
InvertUVTrim
R3SURFA_InvertUVTrim
Integer
R3INT
if true EXOR operation between UV trims is inverted
jsobj.SetInvertUVTrim(value);
R3INT value = ...;
R3SetAttrs(r3obj, R3SURFA_InvertUVTrim, value, R3TAG_END);
TrimOperation
TrimOperation
R3SURFA_TrimOperation
Integer
R3INT
the bool op type used for UV trim objects, see types below
jsobj.SetTrimOperation(value);
R3INT value = ...;
R3SetAttrs(r3obj, R3SURFA_TrimOperation, value, R3TAG_END);
InvertNormal
InvertNormal
R3SURFA_InvertNormal
Boolean
R3BOOL
if true native normal direction is inverted
jsobj.SetInvertNormal(value);
value = jsobj.GetInvertNormal();
R3BOOL value = ...;
R3SetAttrs(r3obj, R3SURFA_InvertNormal, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3SURFA_InvertNormal, &value, R3TAG_END);
Complexity
Complexity
R3SURFA_Complexity
Integer
R3INT
read only, see complexity defs below
value = jsobj.GetComplexity();
R3INT value;
R3GetAttrs(r3obj, R3SURFA_Complexity, &value, R3TAG_END);
r3bbox2d
The optimization data of the base class for perspective camera rayhits
Closest distance to camera pos = render space origin
2D bounding box in image plane - used for slow rayhit objects
data beyond this is private for each derived surface class
Message for RAYHIT
hit distance
Hitting point
UV coords of hitting point if defined
data beyond this point is private. You can reserve some space here by doing R3SetClassAttrs(R3CLID_SURFACE, R3SURFCA_MaxHitdatasize, sizeof(R3RAYHITDATA)+mydatasize, R3TAG_END); You can store rayhit computation data there and reuse it later in EVALUATE method for quick normal computation etc.
currently traced ray
origin of currently traced ray
current display coords 0..1
Do not accept camera ray hits closer than this
Previously hit surface in higher order rayhits.
Zeroeye vector (xeye_x & y below) init state
Two orthogonal unit vectors perpendicular to ray
array of void * pointers
For internal use
for callback above
For internal use
Some example complexity values returned by INITPOSDATA method The greater the value, the more time consuming optimizations raytracer performs prior to rayhit check.
/
r3hitmsg *
r3vector *
r3vector *
r3vector *
r3vector *
r3vector *
r3vector *
r3sbdrop
real/raytr/r3sbdrop.h
r3raytr
r3Surface
R3CLID_SURFACE
r3Sbackdrop
R3CLID_SBACKDROP - 720
int R3RegisterSurfaceBackdropClass(R3APP *app);
r3sball
real/raytr/r3sball.h
r3raytr
Ray tracer's sphere surface.
r3Surface
R3CLID_SURFACE
r3Sball
R3CLID_SBALL - 407
int R3RegisterSurfaceBallClass(R3APP *app);
Center
Center
R3SBALLA_Center
center point
jsobj.SetCenter(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SBALLA_Center, value, R3TAG_END);
R
R
R3SBALLA_R
Number
R3FLOAT
radius
jsobj.SetR(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SBALLA_R, value, R3TAG_END);
Concave
Concave
R3SBALLA_Concave
Boolean
R3BOOL
jsobj.SetConcave(value);
R3BOOL value = ...;
R3SetAttrs(r3obj, R3SBALLA_Concave, value, R3TAG_END);
</sect6><sect6> <title>r3sbili</title>
r3sbili
real/raytr/r3sbili.h
r3raytr
r3Surface
R3CLID_SURFACE
r3Sbilinear
R3CLID_SBILINEAR - 1508
int R3RegisterSurfaceBilinearClass(R3APP *app);
r3scone
real/raytr/r3scone.h
r3raytr
Cone surface class
r3Surface
R3CLID_SURFACE
r3Scone
R3CLID_SCONE - 770
int R3RegisterSurfaceConeClass(R3APP *app);
R
R
R3SCONEA_R
Number
R3FLOAT
diameter of base at 1 distance from the top
jsobj.SetR(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SCONEA_R, value, R3TAG_END);
</sect6><sect6> <title>r3scone2</title>
r3scone2
real/raytr/r3scone2.h
r3raytr
Elliptic cone surface class
r3Surface
R3CLID_SURFACE
r3Scone2
R3CLID_SCONE2 - 771
int R3RegisterSurfaceCone2Class(R3APP *app);
A
A
R3SCONE2A_A
A & C define elliptic opening angles
jsobj.SetA(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SCONE2A_A, value, R3TAG_END);
C
C
R3SCONE2A_C
main cone 'longitude' axis travelling inside cone
jsobj.SetC(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SCONE2A_C, value, R3TAG_END);
</sect6><sect6> <title>r3sbs3</title>
r3sbs3
real/raytr/r3sbs3.h
r3raytr
Cubic b spline class
r3Surface
R3CLID_SURFACE
r3Scubicbspline
R3CLID_SCUBICBSPLINE - 440
int R3RegisterSurfaceCubicSplineClass(R3APP *app);
MixInterpolation
MixInterpolation
R3SBS3A_MixInterpolation
Boolean
R3BOOL
for internal use
jsobj.SetMixInterpolation(value);
R3BOOL value = ...;
R3SetAttrs(r3obj, R3SBS3A_MixInterpolation, value, R3TAG_END);
MaxDisplacement
MaxDisplacement
R3SBS3A_MaxDisplacement
Number
R3FLOAT
if>0, then bumpheight displaces the surface max. this amount
jsobj.SetMaxDisplacement(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SBS3A_MaxDisplacement, value, R3TAG_END);
</sect6><sect6> <title>r3scyl</title>
r3scyl
real/raytr/r3scyl.h
r3raytr
Cylinder Surface Class
r3Surface
R3CLID_SURFACE
r3Scylinder
R3CLID_SCYLINDER - 465
int R3RegisterSurfaceCylinderClass(R3APP *app);
R
R
R3SCYLA_R
Number
R3FLOAT
jsobj.SetR(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SCYLA_R, value, R3TAG_END);
Center
Center
R3SCYLA_Center
jsobj.SetCenter(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SCYLA_Center, value, R3TAG_END);
A
A
R3SCYLA_A
jsobj.SetA(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SCYLA_A, value, R3TAG_END);
Concave
Concave
R3SCYLA_Concave
Boolean
R3BOOL
jsobj.SetConcave(value);
R3BOOL value = ...;
R3SetAttrs(r3obj, R3SCYLA_Concave, value, R3TAG_END);
</sect6><sect6> <title>r3scyl2</title>
r3scyl2
real/raytr/r3scyl2.h
r3raytr
Elliptic cylinder surface class
r3Surface
R3CLID_SURFACE
r3Scylinder2
R3CLID_SCYLINDER2 - 764
int R3RegisterSurfaceCylinder2Class(R3APP *app);
r3sell
real/raytr/r3sell.h
r3raytr
Ellipsoid Surface Class
r3Surface
R3CLID_SURFACE
r3Sellipsoid
R3CLID_SELLIPSOID - 410
int R3RegisterSurfaceEllipsoidClass(R3APP *app);
r3sell2
real/raytr/r3sell2.h
r3raytr
Ellipsoid2 Surface Class (all 3 axes can have different lenghts)
r3Surface
R3CLID_SURFACE
r3Sellipsoid2
R3CLID_SELLIPSOID2 - 412
int R3RegisterSurfaceEllipsoid2Class(R3APP *app);
r3shyp
real/raytr/r3shyp.h
r3raytr
Hyperbolic surface class
r3Surface
R3CLID_SURFACE
r3Shyperbol
R3CLID_SHYPERBOL - 773
int R3RegisterSurfaceHyperbolClass(R3APP *app);
Center
Center
R3SHYPA_Center
hyperbel origin
jsobj.SetCenter(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SHYPA_Center, value, R3TAG_END);
A
A
R3SHYPA_A
rotational axis, length defines asymptotic opening angle
jsobj.SetA(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SHYPA_A, value, R3TAG_END);
R
R
R3SHYPA_R
Number
R3FLOAT
radius in the middle
jsobj.SetR(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SHYPA_R, value, R3TAG_END);
</sect6><sect6> <title>r3shyp2</title>
r3shyp2
real/raytr/r3shyp2.h
r3raytr
Hyperbol surface class (all 3 axes can have different lenghts)
r3Surface
R3CLID_SURFACE
r3Shyperbol2
R3CLID_SHYPERBOL2 - 774
int R3RegisterSurfaceHyperbol2Class(R3APP *app);
r3soarra
real/raytr/r3soarra.h
r3raytr
r3Surface
R3CLID_SURFACE
r3Sobjarray
R3CLID_SOBJARRAY - 741
int R3RegisterSurfaceObjectArrayClass(R3APP *app);
ZBuffer
ZBuffer
R3SOARRA_ZBuffer
Object
R3OBJ*
address of z buffer object the surface uses
jsobj.SetZBuffer(value);
R3OBJ* value = ...;
R3SetAttrs(r3obj, R3SOARRA_ZBuffer, value, R3TAG_END);
</sect6><sect6> <title>r3splane</title>
r3splane
real/raytr/r3splane.h
r3raytr
r3Surface
R3CLID_SURFACE
r3Splane
R3CLID_SPLANE - 416
int R3RegisterSurfacePlaneClass(R3APP *app);
Center
Center
R3SPLANEA_Center
a point in plane
jsobj.SetCenter(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SPLANEA_Center, value, R3TAG_END);
Normal
Normal
R3SPLANEA_Normal
unit normal
jsobj.SetNormal(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3SPLANEA_Normal, value, R3TAG_END);
Onesided
Onesided
R3SPLANEA_Onesided
Boolean
R3BOOL
TRUE if onesided (plane can be seen from outside=against normal direction)
jsobj.SetOnesided(value);
R3BOOL value = ...;
R3SetAttrs(r3obj, R3SPLANEA_Onesided, value, R3TAG_END);
r3appobj *
r3srabez
real/raytr/r3srabez.h
r3raytr
General rational bezier surface class
r3Surface
R3CLID_SURFACE
r3Sratbezier
R3CLID_SRATBEZIER - 494
int R3RegisterSurfaceRationalBezierClass(R3APP *app);
BilinearUV
BilinearUV
R3SRBEZA_BilinearUV
Integer
R3INT
if true then UCorners & VCorners values will be used
jsobj.SetBilinearUV(value);
R3INT value = ...;
R3SetAttrs(r3obj, R3SRBEZA_BilinearUV, value, R3TAG_END);
MaxDisplacement
MaxDisplacement
R3SRBEZA_MaxDisplacement
Number
R3FLOAT
if>0, then bumpheight displaces the surface max. this amount
jsobj.SetMaxDisplacement(value);
R3FLOAT value = ...;
R3SetAttrs(r3obj, R3SRBEZA_MaxDisplacement, value, R3TAG_END);
</sect6><sect6> <title>r3stri</title>
r3stri
real/raytr/r3stri.h
r3raytr
r3Surface
R3CLID_SURFACE
r3Striangle
R3CLID_STRIANGLE - 719
int R3RegisterSurfaceTriangleClass(R3APP *app);
GeometricNormal
GeometricNormal
R3STRIA_GeometricNormal
give if onesided, points to the side from where triangle is visible
jsobj.SetGeometricNormal(value);
R3VECTOR value = ...;
R3SetAttrs(r3obj, R3STRIA_GeometricNormal, value, R3TAG_END);
</sect6>