POV-Ray : Newsgroups : povray.newusers : office help Server Time
31 Oct 2024 08:14:42 EDT (-0400)
  office help (Message 1 to 4 of 4)  
From: babybri11g
Subject: office help
Date: 14 Jul 2009 21:35:00
Message: <web.4a5d31ba9eea80be42789cf80@news.povray.org>
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.

camera { location <0,20,-32> look_at <0,5,-5>}

light_source {<10,25, -25> color rgb <1,1,1>}
 #include "colors.inc"
 # include "textures.inc."
 # include "woods.inc"

# declare table=

union {
box { <-5,0,0> <5,.5,8>
        translate <2.5,0,0>
        texture {Glass}}

box {<-5,0,0> <-4.1,-4,1>
      translate <2.5,0,0>
        texture {pigment{ color White}}}
box {<5,0,0> <4.1,-4,1>
        translate <2.5,0,0>
        texture {pigment { color White}}}
box {<-5,0,5> <-4.1,-5,6>
       translate <2.5,0,0>
        texture {pigment{ color White}}}
box {<5,0,5> <4.1,-5,6>
       translate <2.5,0,0>
       texture {pigment { color White}}}
      }

object {table
translate <11,0,-6>}

plane { <0,1,0>,-5
texture {T_Wood14}}

object {table
translate <-15,0,-6>}

object {table
translate <20,0,10> }

object {table
translate <-23,0,10>}

plane { <0,0,1>,45 texture {pigment{color Black}}}

plane {<1,0,0>,-32 texture {Green_Glass}  }

plane {<1,0,0>30  texture {Green_Glass}    }

//background {color Turquoise}
//camera { location <0,15,-29> look_at <0,5,-5>}

light_source {<10,25, -18> color rgb <1,1,1>}
 #include "colors.inc"
 # include "textures.inc."
 # include "woods.inc"

  #declare desk=

   union {
box {<5,0,0> <-15.2,-7,1>
        translate <11.6,0,0>
        texture {pigment { color White}}}
box { <-5,0,0> <18,.5,8>
        translate <0,0,1>
        texture {Glass}} }



 object {desk
 translate <-3,0,25>}

//camera { location <0,15,-29> look_at <0,5,-5>}
light_source {<10,25, -18> color rgb <1,1,1>}
 #include "colors.inc"
 # include "textures.inc."
 # include "woods.inc"

box {<-3,0,0><0,.5,2>

translate <-10,1,-2>
texture{pigment{color Red}}}


    #declare vase=
lathe{ cubic_spline 13,<0,0><.75,0><.75,.2><.3,.6><.4,.8><.5,1><.7,1.3>
<.8,1.4><1,1.5><.8,1.8><.6,2><.5,2.2><3,2.7>

texture {pigment{color Violet}}}

object {vase
    translate <2,1,8.5>
   scale<2,2,3>}


   declare chair=

   union{
box { <-3,1.8,0>, <-2,2,1>
        texture {pigment { color rgb <1,1,1>}}}
box {<-3,1,0>, <-2.9,1,1>
        translate <0,-1,0>
        texture {pigment {color rgb <1,1,1>}}}
box {<-3.1,-1.5,0>, <-2.9,5,.2>
       texture {pigment {color rgb <1,1,1>}}}
box {<-2,-1.5,0>, <-2.2,2,.2>
        texture {pigment {color rgb <1,1,1>}}}
box {<-3,0,0>, <-2.9,5,1>
        texture {pigment {color rgb <1,1,1>}}}
box {<-3.1,-1.5,1>, <-2.9,5,1>
        texture {pigment {color rgb <1,1,1>}}}
box {<-2,-1.5,1>, <-2.2,2,1>
        texture {pigment{color rgb <1,1,1>}}}
        }

 object {chair

 scale <2.5,.8,2>

 translate <-11,0,-9.8>}

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

 translate <19,0,6>
 }

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      }


merge{

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

rotate y*90

translate <0,0,25>

texture {pigment{color Black}}} object {desk translate <-3,0,25>}}

//the merge didn't seem to work :-(



//Thank You


Post a reply to this message

From: clipka
Subject: Re: office help
Date: 14 Jul 2009 22:45:00
Message: <web.4a5d429929c8d6a33964e90f0@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.

Welcome. Seems like your teacher already taught you the most important thing
already: Where to get help on POV-Ray issues. Two of your classmates already
asked some hours ago :)

Say, how many more classmates should we expect? :P


Some things I noticed about your scene:

- You include the standard include files multiple times, and have multiple light
sources (two of which are actually at the same position). Maybe some more
cleaning up of your code now and then might help. At least for the light
sources, this adversely affects your scene, as it is too bright (judging from
the chairs; you should be able to see a brightness difference between seat and
back).

- Glass objects work best when they are refractive (use the "interior" and "ior"
statements) and have something to reflect (try a brighter rear wall, for
instance, and maybe some ceiling).

- Your desks and chairs seem to be asymmetrical. With the desks, one side is
protruding (the one facing away from us); with the chairs, the left legs seem
to be thinner.

- I see that your objects "float" in the scene. To avoid this, make it a habit
of designing your objects so that y=0 is at floor level, and centered around
x=0 and z=0; this way, they stay on the floor and don't move in an unexpected
way when you scale them (scaling always leaves <0,0,0> at its current position;
all other points will move according to the scaling factor). Also, make it a
habit of *first* rotating, *then* translating (unless you have specific reason
to do otherwise), as rotation is always around <0,0,0>, and will cause all
objects not currently near <0,0,0> to move around in a typically undesired
fashion.

- I'm not sure what your intention is with the "merge". If you intended to give
these a different texture, or move them around together, the proper way of
doing it would be to list the objects first, *then* the desired texture and the
translation, rotations etc. you want to apply collectively. Also note that your
objects must be untextured for this to work, otherwise their own texture will
take precedence.


Post a reply to this message

From: Alain
Subject: Re: office help
Date: 15 Jul 2009 00:17:55
Message: <4a5d5873$1@news.povray.org>

> 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.
> 

Your tables and chairs are floating around, and the table's legs are not 
all of the same length.

It's usualy best, and much simpler, to place your base floor at an 
elevation of zero, and have the bottommost point of your objects also 
defined at zero.

Create all your objects around the origin. That way, they only rotate 
when you rotate them. Also, the won't move if you scale them.
After they are created, rotate them as needed, THEN translate them to 
the desired location.

Sometimes, it also help to model your objects using real world units. 
One POV-unit been used to represent 1 foot, 1 inch, 1 meter, 1 cm, or 
whatever is the more convenient in the current case.

It's often good to define all the light_source toggether. It help to 
prevent duplicates. If the light is to weak, you can give it an 
intencity larger than 1.

What did you expect from the merge at the end? (by the way, you place 
that desk twice at the same location try adding "rotate 12*y" to your 
merge and you'll see)
A merge works the same way as the union with 1 basic difference:
When you union transparent objects, the internal surfaces will remain 
visible.
When you use a merge instead, those internal surfaces are removed.


Alain


Post a reply to this message

From: Reactor
Subject: Re: office help
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.