POV-Ray : Newsgroups : povray.general : Maybe someone can help me ... Server Time
31 Oct 2024 23:28:00 EDT (-0400)
  Maybe someone can help me ... (Message 1 to 6 of 6)  
From: Paul Vanukoff
Subject: Maybe someone can help me ...
Date: 29 Dec 1999 09:22:00
Message: <386a1908@news.povray.org>
I'm trying to create a ying/yang sort of image. Here is some source that
defines the objects. On paper it seems like it would work, but when
rendered, there is a nice gap between the two halves. I have messed around
with different formulae, but can't get it right. Can anyone grok the formula
for this?  :)


// Source //

#declare O_Ying=
union
{
    #declare R=0;
    #while (R<1)
    #declare A=R*180;

        #declare X=1.5*cos(radians(A))+0.5;
        #declare Y=0.0;
        #declare Z=1.5*sin(radians(A));

        sphere
        {
            <X,Y,Z>,R
        }

    #declare R=R+0.01;
    #end
}

#declare O_Yang=
object
{
    O_Ying
    rotate y*180
}

// End Source //

--
Paul Vanukoff
van### [at] primenetcom


Post a reply to this message

From: Paul Vanukoff
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 12:20:21
Message: <386a42d5@news.povray.org>
OK I give up, I just made the Ying/Yang with CSG, dunno why I didn't do that
before. Guess I wanted that puffy spherey look. I wanted a beveled look, but
I have a better idea for that now.


// Source //

#declare O_Ying=
intersection
{
 cylinder
 {
  < 0,-0.1, 0>, < 0, 0.1, 0>, 2
 }
 box
 {
  <-3,-0.2,-3>, < 3, 0.2, 0>
  inverse
 }
 cylinder
 {
  <-1,-0.2, 0>, <-1, 0.2, 0>, 1
  inverse
 }
}

#declare O_Ying=
union
{
 object
 {
  O_Ying
 }
 cylinder
 {
  < 1,-0.2, 0>, < 1, 0.2, 0>, 1
 }
}

// End Source //


--
Paul Vanukoff
van### [at] primenetcom


Post a reply to this message

From: Adam Coffman
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 13:51:24
Message: <386A5828.984A09DC@ipfw.edu>
Is it too late?  I worked out an equation for what I think you're
trying to get.  The radius depends on the angle A in a more
complicated way, but this seems to close up the gap.


#declare O_Ying=
union
{
    #declare R=0;
    #while (R<1.0001)
    #declare A=R*180;

        #declare X=2*cos(radians(A))/(-3+cos(radians(A)));
        #declare Y=0.0;
        #declare Z=2*sin(radians(A))/(-3+cos(radians(A)));

        sphere
        {
            <X,Y,Z>,(-1+cos(radians(A)))/(-3+cos(radians(A)))
        }

    #declare R=R+0.01;
    #end
}

#declare O_Yang=
object
{
    O_Ying
    rotate y*180
}


Adam C.

.......................

Paul Vanukoff wrote:

> I'm trying to create a ying/yang sort of image. Here is some source that
> defines the objects. On paper it seems like it would work, but when
> rendered, there is a nice gap between the two halves. I have messed around
> with different formulae, but can't get it right. Can anyone grok the formula
> for this?  :)
>
> // Source //
>
> #declare O_Ying=
> union
> {
>     #declare R=0;
>     #while (R<1)
>     #declare A=R*180;
>
>         #declare X=1.5*cos(radians(A))+0.5;
>         #declare Y=0.0;
>         #declare Z=1.5*sin(radians(A));
>
>         sphere
>         {
>             <X,Y,Z>,R
>         }
>
>     #declare R=R+0.01;
>     #end
> }
>
> #declare O_Yang=
> object
> {
>     O_Ying
>     rotate y*180
> }
>
> // End Source //
>
> --
> Paul Vanukoff
> van### [at] primenetcom


Post a reply to this message

From: omniVERSE
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 14:06:37
Message: <386a5bbd@news.povray.org>
Please do not cross-post messages to other groups.  I just now realized I
had inadvertently done so too (3 times) by replying to this thread.

Bob


Post a reply to this message

From: Brendt Hess
Subject: Re: Maybe someone can help me ...
Date: 11 Jan 2000 17:42:35
Message: <387bb1db@news.povray.org>
Paul Vanukoff wrote in message <386a1908@news.povray.org>...
>
>I'm trying to create a ying/yang sort of image. Here is some source that
>defines the objects. On paper it seems like it would work, but when
>rendered, there is a nice gap between the two halves. I have messed around
>with different formulae, but can't get it right. Can anyone grok the
formula
>for this?  :)


As I always say, when in doubt - cheat!

This code generates a correct monad (technical term for a yin-yang) using
only primitives and CSG.

Hope it helps.

// A monad (yin/yang without the interior circles) from primitives only.
//
//  Brendt Hess
//

#declare Cyl1=cylinder {<0,0,0>,<0,.1,0>,1}        // size of final monad
#declare Cyl2=cylinder { <0,0,0>,<0,.1,0>,.5}      // 1/2 size of final
monad.

#declare CylPart=difference { object { Cyl1 }
                              object { Cyl2 scale <1,1.01,1> translate
<0,0,.5>}
                              object { Cyl2 scale <1,1.01,1> translate
<0,0,-.5>}
                              box {<-1.01,-.01,-1.01>,<0,.101,1.01>}
                            }

// put the pieces together

#declare YinYang=union { object { CylPart pigment {rgb 1}}
                         object { CylPart rotate y*180 pigment { rgb 0 }}
                         object { Cyl2 translate <0,0,.5> pigment {rgb 1}}
                         object { Cyl2 translate <0,0,-.5> pigment {rgb 0}}
                       }

// now, let's look at it

  camera

    location <0,4,0>
    look_at <0,0,0>
    angle 45
  }

  light_source { <0,10,0> rgb 1}

YinYang
plane {y,-2 pigment {rgb <.5,.5,0>}}
// end of code


Post a reply to this message

From: Brendt Hess
Subject: Re: Maybe someone can help me ...
Date: 11 Jan 2000 19:50:44
Message: <387bcfe4@news.povray.org>
Oops - that's what I get for replying now, reading later :)

Here's a method of doing it from spheres that works as well (based on your
code).  It uses the fact that a sphere at any given point around the radius
r is proportional to the cosine of r/2.

// Source //

#declare O_Ying=
union
{
    #declare R=1;
    #while (R>0)
        #declare A=R*180;
        #declare A1=90-A/2;
        #declare RealR=cos(radians(A1));
        sphere {<0,0,0>,RealR translate < 2-RealR,0,0> rotate y*A}

    #declare R=R-0.01;
    #end
}

#declare O_Yang=
object
{
    O_Ying
    rotate y*180
}

// End Source //

Brendt Hess wrote in message <387bb1db@news.povray.org>...
>
>As I always say, when in doubt - cheat!
>


Post a reply to this message

From: Spock
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 10:33:52
Message: <386a29e0@news.povray.org>
This doesn't work either, but it might give you some ideas...

#include "colors.inc"

global_settings { assumed_gamma 2.2 }

light_source { < -20, 20, -20 > color White }

camera
{
 location < 0, 0, -10 >
 look_at < 0, 0, 0 >
}

#declare O_Ying =
union
{
    #declare R = 0;

    #while( R <= 1 )

        cylinder
        {
            < 0.0, 0.0, -0.002 >,
            < 0.0, 0.0, 0.002 >,
            R
            translate < 1.92 - R, 0, 0 >
            rotate R * R * R * 180 * z
        }

        #declare R = R + 0.01;

    #end
}

object
{
    O_Ying
    rotate -0.1 * y
    pigment { Red }
}

object
{
    O_Ying
    rotate 180 * z
    rotate 0.1 * y
    pigment { White }
}

"Paul Vanukoff" <van### [at] primenetcom> wrote in message
news:386a1908@news.povray.org...
>
> I'm trying to create a ying/yang sort of image. Here is some source that


Post a reply to this message

From: omniVERSE
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 10:58:32
Message: <386a2fa8@news.povray.org>
// I tried this:

#declare O_Ying=
union
{
    #declare R=0;
    #while (R<1)
    #declare A=R*180;

        #declare X=1.5*cos(radians(A));
        #declare Y=0.0;
        #declare Z=1.5*sin(radians(A));

        sphere
        {
            <X,Y,Z>,sqrt(R)*R
        }

    #declare R=R+0.01;
    #end
}

#declare O_Yang=
object
{
    O_Ying
    rotate y*180
}

object {O_Yang pigment {rgb 1} translate <-.575,0,.1>}
object {O_Ying pigment {rgb 0} translate <.575,0,-.1>}

Sloppy isn't it?  There's obviously an equation possible for making this
thing don't you suppose?  I took a look on the infamous 'net and wasn't
successful, or rather there was so much about "Ying-Yang" I couldn't sift
through it all.

// Bob

"Spock" <spo### [at] homecom> wrote in message news:386a29e0@news.povray.org...
> This doesn't work either, but it might give you some ideas...
>
> #include "colors.inc"
>
> global_settings { assumed_gamma 2.2 }
>
> light_source { < -20, 20, -20 > color White }
>
> camera
> {
>  location < 0, 0, -10 >
>  look_at < 0, 0, 0 >
> }
>
> #declare O_Ying =
> union
> {
>     #declare R = 0;
>
>     #while( R <= 1 )
>
>         cylinder
>         {
>             < 0.0, 0.0, -0.002 >,
>             < 0.0, 0.0, 0.002 >,
>             R
>             translate < 1.92 - R, 0, 0 >
>             rotate R * R * R * 180 * z
>         }
>
>         #declare R = R + 0.01;
>
>     #end
> }
>
> object
> {
>     O_Ying
>     rotate -0.1 * y
>     pigment { Red }
> }
>
> object
> {
>     O_Ying
>     rotate 180 * z
>     rotate 0.1 * y
>     pigment { White }
> }
>
> "Paul Vanukoff" <van### [at] primenetcom> wrote in message
> news:386a1908@news.povray.org...
> >
> > I'm trying to create a ying/yang sort of image. Here is some source that
>
>
>


Post a reply to this message

From: Spock
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 11:16:12
Message: <386a33cc@news.povray.org>
I think the problem with the original approach is the outside of the
object does not form part of a circle.  Even if you get the things to
line up perfectly you will end up with an oval at best.

Give the code I posted a try.  I said it doesn't work but it sure looks
good from one angle.  BTW you don't need to rotate by "R * R * R"
but just "R * R" instead.  I was playing around with higher orders to
see if it smoothed things out... not worth it.

You can replace the cylinders in my code with spheres if you really
like the 3D effect.  Here is the modified code:

#include "colors.inc"
global_settings { assumed_gamma 2.2 }
light_source { < -20, 20, -20 > color White }

camera
{
 location < 0, 0, -10 >
 look_at < 0, 0, 0 >
}

#declare O_Ying =
union
{
    #declare R = 0;
    #while( R < 1 )
        sphere
        {
            < 0, 0, 0 >
            R
            translate < 1.92 - R, 0, 0 >
            rotate R * R * 180 * z
        }
        #declare R = R + 0.01;
    #end
}

object
{
    O_Ying
    pigment { Red }
}

object
{
    O_Ying
    rotate 180 * z
    pigment { Blue }
}

background { White }


Post a reply to this message

From: Paul Vanukoff
Subject: Re: Maybe someone can help me ...
Date: 29 Dec 1999 11:20:21
Message: <386a34c5@news.povray.org>
Well, I graphed what I wanted on some paper, and see where (at least part
of) the problem is; when A=90, the X needs to equal 0, but is at 0.5. I
think I know how to fix it, and working on it right now.

--
Paul Vanukoff
van### [at] primenetcom


Post a reply to this message

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