POV-Ray : Newsgroups : povray.general : POV-Ray Quiz : Re: POV-Ray Quiz for Intermediate Users Server Time
4 Aug 2024 16:09:29 EDT (-0400)
  Re: POV-Ray Quiz for Intermediate Users  
From: ABX
Date: 10 Jun 2003 09:02:19
Message: <k0lbevsr7e9ohdhs4oa0jsmc1c1ql73sd8@4ax.com>
On Tue, 10 Jun 2003 15:48:47 +0300, Peter Popov <pet### [at] vipbg> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.