POV-Ray : Newsgroups : povray.newusers : office help : Re: office help Server Time
28 Jul 2024 12:35:34 EDT (-0400)
  Re: office help  
From: Reactor
Date: 15 Jul 2009 01:15:04
Message: <web.4a5d64b029c8d6a38615a2970@news.povray.org>
"babybri11g" <bab### [at] gmailcom> wrote:
> Hello i am a high school student and i am fairly new to pov-ray. I was given an
> assignment to create an office and i would like to get your opnion on it and
> what improvements can be made. the following code is the code for my work in
> progress.
>
..
..
..
> //Thank You


It looks like things are off to a good start.  Some good points were made above
already, most of what I have to add are a few recommendations for code
organization.

  Consider putting certain similar code blocks together.  For instance, all of
your object definitions could be put together, and all of your light_sources
could be put together.  Objects that are near each other within the scene may
be placed next to each other in code, or they may be grouped with similar
objects.  Whichever way you choose, I recommend that you use whitespace,
comments, and indentation liberally.

For example:

object // chair on right in foreground
{
    chair

    scale <3,.8,2>
    translate <13,0,0>
    rotate y*45
}

object // chair on left in background
{
    chair

    scale <3,.8,2>
    translate <8,0,-21>
    rotate y*135
}


is easier to read than

object{chair

scale <3,.8,2>

translate <13,0,0>

rotate y*45}

object{chair scale <3,.8,2>

translate <8,0,-21>

rotate y*135      }


When going through your code, I also wondered whether or not your translate and
rotate statements were working as you expected.  If not, you should be aware
that the order in which transformations are applied is very important.

object{
    chair
    scale <2,1,2>
    rotate <45,0,0>
    translate <2,0,0>
}

is very different from

object{
    chair
    translate <2,0,0>
    scale <2,1,2>
    rotate <45,0,0>
}

which is still different from

object{
    chair
    rotate <45,0,0>
    translate <2,0,0>
    scale <2,1,2>
}


Your transformations are applied in consistent order, but in such a way that
makes the object placement a bit hard to follow.  I personally find it easier
to visualize scaling, rotating, then translating, because I think of it as
selecting the appropriate size, orientations, then placing the object into its
location.

HTH,
-Reactor


Post a reply to this message

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