POV-Ray : Newsgroups : povray.newusers : Mathmatics help (sortof) Server Time
4 Sep 2024 18:13:08 EDT (-0400)
  Mathmatics help (sortof) (Message 1 to 9 of 9)  
From: Rob Brown-Bayliss
Subject: Mathmatics help (sortof)
Date: 18 Aug 2002 02:32:34
Message: <3d5f3f82@news.povray.org>
Hi, 

I am having trouble with mathss, now I know this isn't a maths group, so
ill explain my problem and pray for forgivness..

I have a cylinder object, its verticle like a tower, then rotated (tilted
like the tower of pisa) 15 degrees.

I want to place a series of windows around the tower, but so that they
appear paralel to the ground plane.  These windows are cutouts.

The easy part is making each window vertical, by simply rotating it as I
place them.  But the hard part (for me) is working out the shape or size
of the elipse that a level floor would be...

Am I being clear?  Even though it's a cylinder, because it's tilted the
floor isnotacircle, so I need torotate the windows around an elipse...

I can easily cut holes, but I want to place features on the cylinder
surface.

Were do I begin?

Thanks


Post a reply to this message

From:
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 03:59:57
Message: <3d5f53fd@news.povray.org>
the radius of the long side of the ellips equals the radius of you cylinder
divided by the cosine of the angle of rotation.
the radius short side of the ellips doesn't change.
so if i'm not mistaken you can make a cylinder of limited height and then
scale it in the right direction by an amount of 1/cos(15*pi/180) where the
latter part converts your 15 degrees to radians.

"Rob Brown-Bayliss" <rob### [at] zoismorg> wrote in message
news:3d5f3f82@news.povray.org...
> Hi,
>
> I am having trouble with mathss, now I know this isn't a maths group, so
> ill explain my problem and pray for forgivness..
>
> I have a cylinder object, its verticle like a tower, then rotated (tilted
> like the tower of pisa) 15 degrees.
>
> I want to place a series of windows around the tower, but so that they
> appear paralel to the ground plane.  These windows are cutouts.
>
> The easy part is making each window vertical, by simply rotating it as I
> place them.  But the hard part (for me) is working out the shape or size
> of the elipse that a level floor would be...
>
> Am I being clear?  Even though it's a cylinder, because it's tilted the
> floor isnotacircle, so I need torotate the windows around an elipse...
>
> I can easily cut holes, but I want to place features on the cylinder
> surface.
>
> Were do I begin?
>
> Thanks


Post a reply to this message

From: Mike Williams
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 04:21:14
Message: <uHcw8CAqi1X9Ewhf@econym.demon.co.uk>
Wasn't it Rob Brown-Bayliss who wrote:
>Hi, 
>
>I am having trouble with mathss, now I know this isn't a maths group, so
>ill explain my problem and pray for forgivness..
>
>I have a cylinder object, its verticle like a tower, then rotated (tilted
>like the tower of pisa) 15 degrees.
>
>I want to place a series of windows around the tower, but so that they
>appear paralel to the ground plane.  These windows are cutouts.
>
>The easy part is making each window vertical, by simply rotating it as I
>place them.  But the hard part (for me) is working out the shape or size
>of the elipse that a level floor would be...
>
>Am I being clear?  Even though it's a cylinder, because it's tilted the
>floor isnotacircle, so I need torotate the windows around an elipse...
>
>I can easily cut holes, but I want to place features on the cylinder
>surface.
>
>Were do I begin?

A fairly non-mathematical solution would be to use trace().


A more mathematical solution would be to consider that the semimajor
axis (A) of the ellipse you seek is R/Cos(Theta) where R is the radius
of the original cylinder and Theta is the tilt (15 degrees) expressed in
radians. The semiminor axis (B) of the ellipse is just R. The equation
of an ellipse with semiaxes A and B is x^2/A^2 + z^2/B^2 = 1 so if your
tilt is a z rotation:

        x^2/(R/cos(radians(15))^2 + z^2/R^2 = 1

The centre of the ellipse depends on the height above or below the
centre of rotation. This can be incorporated by substituting 
x => x-y/tan(Theta) in the above equation.

It might be easier to work with parametric equations:

        x = R/cos(radians(15)) * cos(t) - y/tan(radians(15))
        z = R * sin(t)

varying t from 0 to 2*pi.


For example:-

camera { location  <0,2,-5> look_at   <0,2,0>}
light_source { <2,5,-5> colour 1}
plane { y, 0 pigment { rgb 1}}

#declare R=1; // tower radius
#declare H=4; // tower height
#declare Tilt=15; // tower tilt (degrees)

cylinder {0,y*H 1 rotate z*Tilt pigment {rgb 1}}

#declare h=0;           
#while (h<H)
  #declare T=0;
  #while (T<2*pi)           
    #declare X =R/cos(radians(Tilt)) * cos(T) - h*tan(radians(Tilt));           
    #declare Z =R*sin(T);
    sphere {<X,h,Z>,0.05 pigment {rgb <1,1,0>}}
    #declare T=T+0.4;
  #end
  #declare h=h+0.5;
#end

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: James Taylor
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 15:52:29
Message: <3d5ffafd@news.povray.org>
maybe I read what you wanted wrong, but why not differnce the windows from
the cylidner and then rotate the whole thing to the required angle?

jim


Post a reply to this message

From: Rob Brown-Bayliss
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 17:18:54
Message: <3d600f3e@news.povray.org>
On Mon, 19 Aug 2002 07:51:22 +1200, James Taylor wrote:

> maybe I read what you wanted wrong, but why not differnce the windows
> from the cylidner and then rotate the whole thing to the required angle?
> 
> jim
 

Then the windows are at an angle tothe ground, not level, or parallel
with the ground.  What I am trying to achieve is a building leaning on an
angle, but meant to be leaning on an angle, where as the tower of pisa
was not designed to lean over...


Post a reply to this message

From: Rob Brown-Bayliss
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 18:28:18
Message: <3d601f82@news.povray.org>
On Sun, 18 Aug 2002 18:33:50 +1200, Rob Brown-Bayliss wrote:

Thanks for all the help... :o)


Post a reply to this message

From: Christopher James Huff
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 20:54:29
Message: <chrishuff-ADB06F.19412418082002@netplex.aussie.org>
In article <3d600f3e@news.povray.org>,
 Rob Brown-Bayliss <rob### [at] zoismorg> wrote:

> Then the windows are at an angle tothe ground, not level, or parallel
> with the ground.  What I am trying to achieve is a building leaning on an
> angle, but meant to be leaning on an angle, where as the tower of pisa
> was not designed to lean over...

You could shear it instead of rotating. Then the windows and the top and 
bottom would be level with the ground.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Rob Brown-Bayliss
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 21:31:49
Message: <3d604a85@news.povray.org>
On Mon, 19 Aug 2002 12:41:25 +1200, Christopher James Huff wrote:

> In article <3d600f3e@news.povray.org>,
>  Rob Brown-Bayliss <rob### [at] zoismorg> wrote:
> 
>> Then the windows are at an angle tothe ground, not level, or parallel
>> with the ground.  What I am trying to achieve is a building leaning on
>> an angle, but meant to be leaning on an angle, where as the tower of
>> pisa was not designed to lean over...
> 
> You could shear it instead of rotating. Then the windows and the top and
> bottom would be level with the ground.
 

except that it's a cylinder structure, a tower if you will. So as the
windows go around the tower they need to be rotated as well...  Thas the
easy bit, som of the other answers provide thew dificult bits..


Post a reply to this message

From: Christopher James Huff
Subject: Re: Mathmatics help (sortof)
Date: 18 Aug 2002 23:42:10
Message: <chrishuff-6D10AC.22290618082002@netplex.aussie.org>
In article <3d604a85@news.povray.org>,
 Rob Brown-Bayliss <rob### [at] zoismorg> wrote:

> except that it's a cylinder structure, a tower if you will. So as the
> windows go around the tower they need to be rotated as well...  Thas the
> easy bit, som of the other answers provide thew dificult bits..

I don't understand. Cutting the windows out of a plain cylinder seems 
easy enough, then just shear the result.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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