POV-Ray : Newsgroups : povray.newusers : Problems declaring objects Server Time
30 Jul 2024 08:15:20 EDT (-0400)
  Problems declaring objects (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Oleguer Vilella
Subject: Re: Problems declaring objects
Date: 15 Sep 2004 10:26:21
Message: <4148510d$1@news.povray.org>
Hi again Tim,

I think thats right... I have changed some numbers and when I calculated the
picture, appears all on the correct position.
That's the code:
=====================================
//Per fer els punts dels quarts.
#declare Puntos = union {
sphere { <-0.3, -0.7, 0>, 0.1 pigment { color White } finish { ambient 1 }
translate <2.1, 9.7, -4> }
sphere { <-0.35, 0.15, 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> }
no_shadow
}
//Agulles del relotge.
#declare Agulles = union {
box { <-1, 0, -3.5> <-0.8, .2, 3.5> pigment { color Black } finish { ambient
1 } translate <-0.22, 8.2, -4> rotate <9, 0, 0> no_shadow }
box { <-1, 0, -1> <-0.8, .2, 0.5> pigment { color Black } finish { ambient
1 } translate <1.12, -0.5, -10> rotate <60, 30, 0> no_shadow }
translate y*0.5
}
//Cilindre que unix les agulles.
#declare Cilindre =
cylinder { <0, 0.9, -0.5> <0, 1, 1> 0.035 texture { T_Gold_1D } finish {
specular 2 ambient 1 diffuse .07 reflection 0 phong 0.3 phong_size 30 }
rotate y*25 rotate x*-2 translate <-3.18, 8.8, -6>
}
//Declarant les diverses parts.
#declare Todo_Reloj = union {
object { Reloj rotate y*115 translate <0, 0, 0> scale 0.5  }
object { Puntos translate 0.5 scale 0.5 translate 0 }
object { Agulles translate 0.5 scale 0.5 translate 0 }
object { Cilindre translate 0.5 scale 0.5 translate y*0  }
no_shadow
}
//Declarant tot junt.
object { Todo_Reloj no_shadow translate y*0  }
====================================
Now I have to adjust the "Cilindre", but it's easy and quick.
Do you think that's right?

Best regards,
Oleguer


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Problems declaring objects
Date: 15 Sep 2004 10:28:11
Message: <4148517b@news.povray.org>
Thank you very much, Tom, for gives me your document, it's very interesting
and it helped me to understood my problem.

Regards,
Oleguer



news:414818d7$1@news.povray.org...
> "Oleguer Vilella" <ole### [at] infonegociocom> wrote in message
> news:41481108$1@news.povray.org...
>
> > Some of the objects appear also moved.
> > I'm thinking....
>
> When you scale an object, the only point of the object that won't move is
the
> point that rests at <0,0,0> (assuming that you're scaling all axis).
>
> To understand what is happening, try the following scene using different
values
> for myScale. Note that we divide the radius of the spheres by the value of
> myScale. This means that the scale size doesn't affect the radius of the
> spheres, only their positions.
>
> camera {
>   location  <0.0, 0.0, -10.0>
>   look_at   <0.0, 0.0,  0.0>
> }
>
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
>
> #declare myScale = 1;
>
> sphere{
>   0,0.25/myScale
>   scale myScale
>   pigment{rgb<1,0,0>}
> }
>
> sphere{
>   1,0.25/myScale
>   scale myScale
>   pigment{rgb<0,1,0>}
> }
>
>
>
>


Post a reply to this message

From: Tim Nikias
Subject: Re: Problems declaring objects
Date: 15 Sep 2004 11:00:31
Message: <4148590f$1@news.povray.org>
I've just used your scene and took a look at it. Have you tried moving the
camera?
If, for example, you place the camera at <-20,8,0> you'll notice a few
problems your clock has.

It seems to me like you are building the clock to work from a specific
angle, instead, you should try building the clock as it would be in real
world. Maybe by measuring a real clock, you can see how high certain objects
are, and how thick, etc. Another thing you should try to do is keep the code
clean and easy to understand. For example, the white dots you use to
represent 12, 3, 6 and 9 o'clock are translated multiple times before they
are at their final location.

Just take your first white sphere. It is centered at <-0.3,-0.7,0> and you
translate it by <2.1,9.7,-4>. Then, later, you reference the object and then
apply "translate 0.5 scale 0.5" to it. It would be much easier to simply
create the sphere at <0,0,0>, then position it where you want it using a
single "translate", e.g. like this:
sphere{<0,0,0>,0.1 pigment{color White}finish{ambient 1}
translate <1.8,9,-4>
}

Or, much easier, like this:
sphere{<1.8,9,-4>,0.1 pigment{color White}finish{ambient 1}}

A question that comes to mind when looking at the object and your questions
is if you properly understand the cartesian coordinate system used by
POV-Ray? This is not meant to taunt you, but a proper understanding of it
would be very useful when working with POV-Ray. Did you take a few Advanced
Geometry classes at school or college, by any chance? You'd get a good idea
of the coordinate system that way.

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


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Problems declaring objects
Date: 15 Sep 2004 14:30:59
Message: <41488a63@news.povray.org>
Yes, you have the reason, that's very confused. Now I'm simplifing them,
because is very confused. I don't like this kind of numbers, some of them
are very big and they are multiplied a lot of times, I must reduce them.

Thank you very much,
Oleguer






mensaje news:4148590f$1@news.povray.org...
> I've just used your scene and took a look at it. Have you tried moving the
> camera?
> If, for example, you place the camera at <-20,8,0> you'll notice a few
> problems your clock has.
>
> It seems to me like you are building the clock to work from a specific
> angle, instead, you should try building the clock as it would be in real
> world. Maybe by measuring a real clock, you can see how high certain
objects
> are, and how thick, etc. Another thing you should try to do is keep the
code
> clean and easy to understand. For example, the white dots you use to
> represent 12, 3, 6 and 9 o'clock are translated multiple times before they
> are at their final location.
>
> Just take your first white sphere. It is centered at <-0.3,-0.7,0> and you
> translate it by <2.1,9.7,-4>. Then, later, you reference the object and
then
> apply "translate 0.5 scale 0.5" to it. It would be much easier to simply
> create the sphere at <0,0,0>, then position it where you want it using a
> single "translate", e.g. like this:
> sphere{<0,0,0>,0.1 pigment{color White}finish{ambient 1}
> translate <1.8,9,-4>
> }
>
> Or, much easier, like this:
> sphere{<1.8,9,-4>,0.1 pigment{color White}finish{ambient 1}}
>
> A question that comes to mind when looking at the object and your
questions
> is if you properly understand the cartesian coordinate system used by
> POV-Ray? This is not meant to taunt you, but a proper understanding of it
> would be very useful when working with POV-Ray. Did you take a few
Advanced
> Geometry classes at school or college, by any chance? You'd get a good
idea
> of the coordinate system that way.
>
> -- 
> "Tim Nikias v2.0"
> Homepage: <http://www.nolights.de>
>
>


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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