POV-Ray : Newsgroups : povray.newusers : Problems with #declare Server Time
26 Nov 2024 07:40:10 EST (-0500)
  Problems with #declare (Message 1 to 9 of 9)  
From: Oleguer Vilella
Subject: Problems with #declare
Date: 9 Sep 2004 04:12:10
Message: <4140105a@news.povray.org>
Hi all,

I did this object, and the small white spheres a part from it, when I put
the spheres into the #declare they desappear, but If I render the file whit
the spheres out of the #declare they are in the right place. What's the
problem?
The code is:
===========The camera==============
#include "colors.inc"
#include "shapes.inc"
#include "stones.inc"
#include "textures.inc"
#include "woods.inc"
#include "metals.inc"
#include "golds.inc"
#include "glass.inc"
#include "glass_old.inc"

global_settings { assumed_gamma 2 }
background { color White }
camera { location <-10, 8, -19> look_at <0, 5, 0> }
light_source { <0, 33, 0> color White spotlight point_at <0, 0, 0> radius 50
falloff 20 tightness 0  }
light_source { <0, 19, 0> color rgb <0.5, 0.5, 0.5> }
light_source { <40, 25, 0> color rgb <1, 1, 1>
spotlight
point_at <0, 5, 0>
radius 20
falloff 20  }
=========End of the camera===============
============The object===============
#declare Reloj =
union {
  merge {
    box {<-5,0,-55>,<0,95,55>}
    cylinder{<-5,95,0>,<0,95,0>,55}
   texture { T_Wood15 } finish { specular .51 ambient 1 diffuse .96 }
  scale 0.1}

difference {
    cylinder{<-10,95,0>,<20,95,0>,40}
    cylinder{<-11,95,0>,< 6,95,0>,36}
    texture { T_Gold_1D } finish { specular 2 ambient 1 diffuse .07
reflection 0.1 phong 0.3 phong_size 30 }
    scale 0.1}}
object { Reloj rotate y*115 translate <0, 0, 0> }
=============End of the object============
===========The spheres================
sphere { <0, 0, 0>, 0.1 pigment { color White } finish { ambient 1 }
translate <2.1, 9.7, -4> }
sphere { <0, 0, 0>, .1 pigment { color White } finish { ambient 1 }
translate <-5.4, 9.35, -4> }
sphere { <0, 0, 0>, .1 pigment { color White } finish { ambient 1 }
translate <-2.2, 12.6, -4> }
sphere { <0, 0, 0>, .1 pigment { color White } finish { ambient 1 }
translate <-2.2, 6, -4> }
===========End of the spheres=============
Thanks in advance.

Best regards,
Oleguer
http://www.infonegocio.com/oleguervm


Post a reply to this message

From: Josh
Subject: Re: Problems with #declare
Date: 9 Sep 2004 04:37:42
Message: <41401656$1@news.povray.org>
I'm guessing here as I havn't tried rendering you code but there appears to
be a missing semi colon after your declare e.g.
> #declare Reloj =
> union {
>   merge {
>     box {<-5,0,-55>,<0,95,55>}
>     cylinder{<-5,95,0>,<0,95,0>,55}
>    texture { T_Wood15 } finish { specular .51 ambient 1 diffuse .96 }
>   scale 0.1}
>
> difference {
>     cylinder{<-10,95,0>,<20,95,0>,40}
>     cylinder{<-11,95,0>,< 6,95,0>,36}
>     texture { T_Gold_1D } finish { specular 2 ambient 1 diffuse .07
> reflection 0.1 phong 0.3 phong_size 30 }
>     scale 0.1}} ;   <===================================== Here...
> object { Reloj rotate y*115 translate <0, 0, 0> }


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Problems with #declare
Date: 9 Sep 2004 05:56:50
Message: <414028e2$1@news.povray.org>
If I put like this:
===================================
#declare Reloj =
union {
  merge {
    box {<-5,0,-55>,<0,95,55>}
    cylinder{<-5,95,0>,<0,95,0>,55}
   texture { T_Wood15 } finish { specular .51 ambient 1 diffuse .96 }
  scale 0.1}

difference {
    cylinder{<-10,95,0>,<20,95,0>,40}
    cylinder{<-11,95,0>,< 6,95,0>,36}
    texture { T_Gold_1D } finish { specular 2 ambient 1 diffuse .07
reflection 0.1 phong 0.3 phong_size 30 }
    scale 0.1}};

sphere { <0, 0, 0>, 0.1 pigment { color White } finish { ambient 1 }
translate <2.1, 9.7, -4> }
sphere { <0, 0, 0>, .1 pigment { color White } finish { ambient 1 }
translate <-5.4, 9.35, -4> }
sphere { <0, 0, 0>, .1 pigment { color White } finish { ambient 1 }
translate <-2.2, 12.6, -4> }
sphere { <0, 0, 0>, .1 pigment { color White } finish { ambient 1 }
translate <-2.2, 6, -4> }
 object { Reloj rotate y*115 translate <0, 0, 0> }
==================================
It works good, but I closed the union after the difference and I need to
have the spheres into de union, to call them with the name "Reloj".
If I put the semi colon after the difference and I don't close the union, it
gives me an error and it doesn't render the image.
Josh, why you put this semi colon? I only use the semi colons with the
macros, for exemple: "#local tt= -1.1;"
or something like this.
Thank you Josh.

Regards,
Oleguer



news:41401656$1@news.povray.org...
> I'm guessing here as I havn't tried rendering you code but there appears
to
> be a missing semi colon after your declare e.g.
> > #declare Reloj =
> > union {
> >   merge {
> >     box {<-5,0,-55>,<0,95,55>}
> >     cylinder{<-5,95,0>,<0,95,0>,55}
> >    texture { T_Wood15 } finish { specular .51 ambient 1 diffuse .96 }
> >   scale 0.1}
> >
> > difference {
> >     cylinder{<-10,95,0>,<20,95,0>,40}
> >     cylinder{<-11,95,0>,< 6,95,0>,36}
> >     texture { T_Gold_1D } finish { specular 2 ambient 1 diffuse .07
> > reflection 0.1 phong 0.3 phong_size 30 }
> >     scale 0.1}} ;   <===================================== Here...
> > object { Reloj rotate y*115 translate <0, 0, 0> }
>
>


Post a reply to this message

From: Josh
Subject: Re: Problems with #declare
Date: 9 Sep 2004 06:19:04
Message: <41402e18$1@news.povray.org>
I always end declares with a semi colon, I thought you had to!


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Problems with #declare
Date: 9 Sep 2004 06:25:51
Message: <41402faf@news.povray.org>
No, I hadn't done. Try my code and you will see it.


news:41402e18$1@news.povray.org...
> I always end declares with a semi colon, I thought you had to!
>
>


Post a reply to this message

From: Josh
Subject: Re: Problems with #declare
Date: 9 Sep 2004 06:42:55
Message: <414033af@news.povray.org>
I've rendered your code and the results are weird!!!!  I cant see any reason
for it , but this get you round the problem....



#declare spheres = union        {
        sphere { <0, 0, 0>, 0.1 texture {pigment { color White } finish {
ambient 1 }}
        translate <2.1, 9.7, -4> }
        sphere { <0, 0, 0>, .1 texture {pigment { color White } finish {
ambient 1 }}
        translate <-5.4, 9.35, -4> }
        sphere { <0, 0, 0>, .1 texture {pigment { color White } finish {
ambient 1 }}
        translate <-2.2, 12.6, -4> }
        sphere { <0, 0, 0>, .1 texture {pigment { color White } finish {
ambient 1 }}
        translate <-2.2, 6, -4> }
        };

#declare combo = union  {

                object { Reloj rotate y*115 translate <0, 0, 0> }
                object { spheres}
                };

object { combo }


Post a reply to this message

From: Tim Nikias
Subject: Re: Problems with #declare
Date: 9 Sep 2004 07:50:39
Message: <4140438f@news.povray.org>
I'm not quiet sure what you're trying to do, and where you put the spheres
into the declaration of the object. But you need to keep in mind that once
the spheres are inside the declaration, they get moved around with the
object. So when you're object is put like this:

> object { Reloj rotate y*115 translate <0, 0, 0> }

The spheres would also get rotated around the y-axis by 115 degrees. Thus
they are not where you placed them. Might that be the problem?

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Problems with #declare
Date: 9 Sep 2004 09:15:00
Message: <41405754$1@news.povray.org>
Yes Josh and Tim, that's it. Problem solved.

Thank you very much.

Oleguer


news:414033af@news.povray.org...
> I've rendered your code and the results are weird!!!!  I cant see any
reason
> for it , but this get you round the problem....
>
>
>
> #declare spheres = union        {
>         sphere { <0, 0, 0>, 0.1 texture {pigment { color White } finish {
> ambient 1 }}
>         translate <2.1, 9.7, -4> }
>         sphere { <0, 0, 0>, .1 texture {pigment { color White } finish {
> ambient 1 }}
>         translate <-5.4, 9.35, -4> }
>         sphere { <0, 0, 0>, .1 texture {pigment { color White } finish {
> ambient 1 }}
>         translate <-2.2, 12.6, -4> }
>         sphere { <0, 0, 0>, .1 texture {pigment { color White } finish {
> ambient 1 }}
>         translate <-2.2, 6, -4> }
>         };
>
> #declare combo = union  {
>
>                 object { Reloj rotate y*115 translate <0, 0, 0> }
>                 object { spheres}
>                 };
>
> object { combo }
>
>


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Problems with #declare
Date: 9 Sep 2004 09:51:14
Message: <41405fd2@news.povray.org>
Yes that's the problem. I have to put the spheres outside of the "Reloj"
declaration, because there's a rotate.

Thanks again,

Oleguer


mensaje news:4140438f@news.povray.org...
> I'm not quiet sure what you're trying to do, and where you put the spheres
> into the declaration of the object. But you need to keep in mind that once
> the spheres are inside the declaration, they get moved around with the
> object. So when you're object is put like this:
>
> > object { Reloj rotate y*115 translate <0, 0, 0> }
>
> The spheres would also get rotated around the y-axis by 115 degrees. Thus
> they are not where you placed them. Might that be the problem?
>
> Regards,
> Tim
>
> -- 
> "Tim Nikias v2.0"
> Homepage: <http://www.nolights.de>
>
>


Post a reply to this message

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