Lathe::Lathe() : ObjectBase(LATHE_OBJECT) { Trans = Create_Transform(); Spline_Type = LINEAR_SPLINE; Number = 0; Spline = NULL; Radius1 = 0.0; Radius2 = 0.0; Height1 = 0.0; Height2 = 0.0; }
void Polygon::Transform(const TRANSFORM *tr) { Vector3d N; if(Trans == NULL) Trans = Create_Transform(); Compose_Transforms(Trans, tr); N = Vector3d(0.0, 0.0, 1.0); MTransNormal(S_Normal, N, Trans); S_Normal.normalize(); Compute_BBox(); }
Disc::Disc() : ObjectBase(DISC_OBJECT) { center = Vector3d(0.0, 0.0, 0.0); normal = Vector3d(0.0, 0.0, 1.0); iradius2 = 0.0; oradius2 = 1.0; d = 0.0; Trans = Create_Transform(); /* Default bounds */ Make_BBox(BBox, -1.0, -1.0, -SMALL_TOLERANCE, 2.0, 2.0, 2.0 * SMALL_TOLERANCE); }
POLYGON *Create_Polygon() { POLYGON *New; New = (POLYGON *)POV_MALLOC(sizeof(POLYGON), "polygon"); INIT_OBJECT_FIELDS(New,POLYGON_OBJECT,&Polygon_Methods) New->Trans = Create_Transform(); Make_Vector(New->S_Normal, 0.0, 0.0, 1.0); New->Data = NULL; return (New); }
Parametric::Parametric() : ObjectBase(PARAMETRIC_OBJECT) { Make_Vector(container.box.corner1, -1.0, -1.0, -1.0); Make_Vector(container.box.corner2, 1.0, 1.0, 1.0); Make_BBox(BBox, -1.0, -1.0, -1.0, 2.0, 2.0, 2.0); Trans = Create_Transform(); Function[0] = NULL; Function[1] = NULL; Function[2] = NULL; accuracy = 0.001; max_gradient = 1; Inverted = false; PData = NULL; container_shape = 0; }
ISOSURFACE* Create_IsoSurface() { ISOSURFACE * New; New = (ISOSURFACE *)POV_MALLOC(sizeof(ISOSURFACE), "isosurface"); INIT_OBJECT_FIELDS(New, ISOSURFACE_OBJECT, &IsoSurface_Methods) Make_Vector(New->container.box.corner1, -1.0, -1.0, -1.0); Make_Vector(New->container.box.corner2, 1.0, 1.0, 1.0); Make_BBox(New->BBox, -1.0, -1.0, -1.0, 2.0, 2.0, 2.0); New->Trans = Create_Transform(); New->Function = NULL; New->accuracy = 0.001; New->max_trace = 1; New->cache = false; New->eval_param[0] = 0.0; // 1.1; // not necessary New->eval_param[1] = 0.0; // 1.4; // not necessary New->eval_param[2] = 0.0; // 0.99; // not necessary New->eval = false; New->closed = true; New->Inv3 = 1; New->container_shape = 0; New->max_gradient = 1.1; New->gradient = 0.0; New->threshold = 0.0; New->mginfo = (ISO_Max_Gradient *)POV_MALLOC(sizeof(ISO_Max_Gradient), "isosurface max_gradient info"); New->mginfo->refcnt = 1; New->mginfo->max_gradient = 0.0; New->mginfo->gradient = 0.0; // not really necessary yet [trf] New->mginfo->eval_max = 0.0; New->mginfo->eval_cnt = 0.0; New->mginfo->eval_gradient_sum = 0.0; return New; }
Lemon::Lemon() : ObjectBase(LEMON_OBJECT) { apex = Vector3d(0.0, 0.0, 1.0); base = Vector3d(0.0, 0.0, 0.0); apex_radius = 0.0; base_radius = 0.0; inner_radius = 0.5; Trans = Create_Transform(); /* Lemon has capped ends by default. */ Set_Flag(this, CLOSED_FLAG); /* Default bounds */ Make_BBox(BBox, -1.0, -1.0, 0.0, 2.0, 2.0, 1.0); }
Cone::Cone() : ObjectBase(CONE_OBJECT) { apex = Vector3d(0.0, 0.0, 1.0); base = Vector3d(0.0, 0.0, 0.0); apex_radius = 1.0; base_radius = 0.0; dist = 0.0; Trans = Create_Transform(); /* Cone/Cylinder has capped ends by default. */ Set_Flag(this, CLOSED_FLAG); /* Default bounds */ Make_BBox(BBox, -1.0, -1.0, 0.0, 2.0, 2.0, 1.0); }
void Camera::Init() { Make_Vector(Location, 0.0, 0.0, 0.0); Make_Vector(Direction, 0.0, 0.0, 1.0); Make_Vector(Up, 0.0, 1.0, 0.0); Make_Vector(Right, 1.33, 0.0, 0.0); Make_Vector(Sky, 0.0, 1.0, 0.0); Make_Vector(Look_At, 0.0, 0.0, 1.0); Make_Vector(Focal_Point, 0.0, 0.0, 1.0); /* Init focal blur stuff (not used by default). */ Blur_Samples = 0; Blur_Samples_Min = 0; Confidence = 0.9; Variance = 1.0 / 10000.0; Aperture = 0.0; Focal_Distance = -1.0; /* Set default camera type and viewing angle. [DB 7/94] */ Type = PERSPECTIVE_CAMERA; Angle = 90.0; /* Default view angle for spherical camera. [MH 6/99] */ H_Angle = 360; V_Angle = 180; /* Do not perturb primary rays by default. [DB 7/94] */ Tnormal = NULL; Bokeh = NULL; // no user-defined bokeh by default Trans = Create_Transform(); Rays_Per_Pixel = 1; Face_Distribution_Method = 0; Smooth = false; Max_Ray_Distance = 0.0; }
void Transform_Object (OBJECT *Object, TRANSFORM *Trans) { OBJECT *Sib; if (Object == NULL) { return; } for (Sib = Object->Bound; Sib != NULL; Sib = Sib->Sibling) { Transform_Object(Sib, Trans); } if (Object->Clip != Object->Bound) { for (Sib = Object->Clip; Sib != NULL; Sib = Sib->Sibling) { Transform_Object(Sib, Trans); } } /* NK 1998 added if */ if (!Test_Flag(Object, UV_FLAG)) { Transform_Textures(Object->Texture, Trans); Transform_Textures(Object->Interior_Texture, Trans); } if (Object->UV_Trans == NULL) Object->UV_Trans = Create_Transform(); Compose_Transforms(Object->UV_Trans, Trans); Transform_Interior(Object->Interior, Trans); Transform(Object,Trans); }
DISC *Create_Disc () { DISC *New; New = (DISC *)POV_MALLOC(sizeof (DISC), "disc"); INIT_OBJECT_FIELDS(New, DISC_OBJECT, &Disc_Methods) Make_Vector (New->center, 0.0, 0.0, 0.0); Make_Vector (New->normal, 0.0, 0.0, 1.0); New->iradius2 = 0.0; New->oradius2 = 1.0; New->d = 0.0; New->Trans = Create_Transform(); /* Default bounds */ Make_BBox(New->BBox, -1.0, -1.0, -Small_Tolerance, 2.0, 2.0, 2.0 * Small_Tolerance); return (New); }
CAMERA *Create_Camera() { CAMERA *New; New = (CAMERA *)POV_MALLOC(sizeof (CAMERA), "camera"); Make_Vector(New->Location, 0.0, 0.0, 0.0); Make_Vector(New->Direction, 0.0, 0.0, 1.0); Make_Vector(New->Up, 0.0, 1.0, 0.0); Make_Vector(New->Right, 1.33, 0.0, 0.0); Make_Vector(New->Sky, 0.0, 1.0, 0.0); Make_Vector(New->Look_At, 0.0, 0.0, 1.0); Make_Vector(New->Focal_Point, 0.0, 0.0, 1.0); /* Init focal blur stuff (not used by default). */ New->Blur_Samples = 0; New->Confidence = 0.9; New->Variance = 1.0 / 10000.0; New->Aperture = 0.0; New->Focal_Distance = -1.0; /* Set default camera type and viewing angle. [DB 7/94] */ New->Type = PERSPECTIVE_CAMERA; New->Angle = 90.0; /* Default view angle for spherical camera. [MH 6/99] */ New->H_Angle = 360; New->V_Angle = 180; /* Do not perturb primary rays by default. [DB 7/94] */ New->Tnormal = NULL; New->Trans = Create_Transform(); return (New); }
Superellipsoid::Superellipsoid() : ObjectBase(SUPERELLIPSOID_OBJECT) { Trans = Create_Transform(); Power = Vector3d(2.0, 2.0, 2.0); }