|
![](/i/fill.gif) |
On Tue, 10 Jun 2003 15:48:47 +0300, Peter Popov <pet### [at] vip bg> wrote:
> > When you apply transform to CGS each scale, translate, rotate etc. cause
> > separate calculation of transformation matrix and applying it to all children of
> > this object.
>
> Are you sure about that? IIRC the logic behind CGS is that when a ray
> is traced, it is first reverse-transformed by the CSG transformation,
> and then for each child that has a transform, it is
> reverse-transformed by the child transformation. Or am I wrong?
Well, I did not debuged it but ...
void Parse_Object_Mods (OBJECT *Object)
{
...
CASE (TRANSLATE_TOKEN)
Parse_Vector (Local_Vector);
Compute_Translation_Transform(&Local_Trans, Local_Vector);
Translate_Object (Object, Local_Vector, &Local_Trans);
END_CASE
...
}
and ...
void Translate_Object (OBJECT *Object, VECTOR Vector, TRANSFORM *Trans)
{
...
Translate(Object, Vector, Trans);
}
and ...
#define Translate(x,y,z) ((*((x)->Methods->Translate_Method)) (x,y,z))
and ...
static void Translate_CSG (OBJECT *Object, VECTOR Vector, TRANSFORM *Trans)
{
OBJECT *Sib;
for (Sib = ((CSG *) Object)->Children; Sib != NULL; Sib = Sib->Sibling)
{
Translate_Object(Sib, Vector, Trans);
}
Recompute_BBox(&Object->BBox, Trans);
}
and intersection tests for CSG seems not contain transforming of ray.
ABX
Post a reply to this message
|
![](/i/fill.gif) |