POV-Ray : Newsgroups : povray.windows : how to create a random coil Server Time
17 May 2024 07:51:21 EDT (-0400)
  how to create a random coil (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: zj905
Subject: Re: how to create a random coil
Date: 19 Oct 2007 20:35:00
Message: <web.47194d14144555e34849a21c0@news.povray.org>
Thanks. It is pretty close to what I want. Here is a beautiful image
demonstrating what I want to plot:
http://web.mit.edu/newsoffice/2003/smartsurface.html. Lots of chains were
grafted on a surface. They are rooted on the surface and grow upward
randomly. Any good suggestion?
Charles C <"nospam a nospam.com"> wrote:
> zj905 wrote:
> > I am doing some work on chemistry. The random coil looks like... It is
> > better to give a sample. Please see this picture:
> > http://www.psc.edu/science/Darden/bpti_spline_dense2.GIF. In this graph,
> > the white-yellow chains are random coils. How to draw that? Thanks.
>
>
> I typed something up but seeing this picture makes me think it might not
> be quite what you're looking for either.  (Looks like my lines are a
> little too long.) I'm posting it anyway in case it might still have some
> relevance:
>
> Charles
>
> //          /
> //****   o-/--   ************************
> //        o
>
> #include "colors.inc"
>
> global_settings {
>    assumed_gamma 1.0
> }
>
> camera {
>    location  <0.0, 0.5, -4.0>
>    direction 1.5*z
>    right     x*image_width/image_height
>    look_at   <0.0, 0.0,  0.0>
> }
>
> sky_sphere {
>    pigment {
>      gradient z
>      color_map {
>        [0.0 rgb <0.6,0.7,1.0>]
>        [0.7 rgb <0.0,0.1,0.8>]
>      }
>    }
> }
>
> light_source {
>    <0, 0, 0>            // light's position (translated below)
>    color rgb <1, 1, 1>  // light's color
>    translate <-30, 30, -30>
> }
>
> // ^^^^^ The above is modified from the POV-Ray for Windows insert menu
> ^^^^^
>
>
> #declare Wraps = 10;
> #declare BallRad = 1;
> #declare Increment_Val = 0.001;
> #declare Ctr = 0-Increment_Val;
> #declare MyRand = seed(0);
> #declare ThisRandVec = <rand(MyRand),rand(MyRand),rand(MyRand)>;
> //
> #declare MySpline =
> spline{cubic_spline
>    //Ctr,
> vrotate(<BallRad,0,0>,<rand(MyRand),rand(MyRand),rand(MyRand)>*360),
>    Ctr, vrotate(<BallRad,0,0>,ThisRandVec*360*Ctr*Wraps),
>    #declare Ctr = Ctr+Increment_Val; //now 0.... could'a just written 0.
>    #while(Ctr <= 1+Increment_Val)
>        //Ctr, vrotate(<1,0,0>,<rand(MyRand),rand(MyRand),rand(MyRand)>*360),
>          Ctr, vrotate(<BallRad,0,0>,ThisRandVec*360*Ctr*Wraps),
>        #declare Ctr = Ctr+Increment_Val;
>    #end //end while
> }//end spline
>
>
> #declare SphereRad = .01;
> #declare NumOfSpheres = 10000;
> #declare Ctr = 0;
> #declare A_Random_Coil =
> union{
>   #local Ctr = 0;
>   #while (Ctr <= 1)
>     sphere {
>       MySpline(Ctr),SphereRad
>       pigment { rgb <1-Ctr,Ctr,0> }
>       }
>     #local Ctr = Ctr + 1/NumOfSpheres;
>   #end
> } //end union
>
>
> #object{A_Random_Coil}
>
> //          /
> //****   o-/--   ************************
> //        o


Post a reply to this message

From: Charles C
Subject: Re: how to create a random coil
Date: 19 Oct 2007 21:31:17
Message: <47195a65@news.povray.org>
zj905 wrote:
> Thanks. It is pretty close to what I want. Here is a beautiful image
> demonstrating what I want to plot:
> http://web.mit.edu/newsoffice/2003/smartsurface.html. Lots of chains were
> grafted on a surface. They are rooted on the surface and grow upward
> randomly. Any good suggestion?

Hmm, have a look at this.   I hope you don't mind rough inline-code 
examples rather than a paragraph descriptions.

Charles

//          /
//****   o-/--   ************************
//        o

#include "colors.inc"

global_settings {
   assumed_gamma 1.0
}

camera {
   location  <0.0, 0.5, -4.0>
   direction 1.5*z
   right     x*image_width/image_height
   look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
   pigment {
     gradient z
     color_map {
       [0.0 rgb <0.6,0.7,1.0>]
       [0.7 rgb <0.0,0.1,0.8>]
     }
   }
}

light_source {
   <0, 0, 0>            // light's position (translated below)
   color rgb <1, 1, 1>  // light's color
   translate <-30, 30, -30>
}

// ^^^^^ The above is modified from the POV-Ray for Windows insert menu 
^^^^^

//
//#declare Wraps = 100;
//#declare BallRad = 1;
//#declare Increment_Val = 0.001;
//#declare Ctr = 0-Increment_Val;
//#declare MyRand = seed(0);
//#declare ThisRandVec = <rand(MyRand),rand(MyRand),rand(MyRand)>;
////
//#declare MySpline =
//spline{cubic_spline
//  //Ctr, 
vrotate(<BallRad,0,0>,<rand(MyRand),rand(MyRand),rand(MyRand)>*360),
//  Ctr, vrotate(<BallRad,0,0>,ThisRandVec*360*Ctr*Wraps),
//  #declare Ctr = Ctr+Increment_Val; //now 0.... could'a just written 0.
//  #while(Ctr <= 1+Increment_Val)
//      //Ctr, 
vrotate(<1,0,0>,<rand(MyRand),rand(MyRand),rand(MyRand)>*360),
//        Ctr, vrotate(<BallRad,0,0>,ThisRandVec*360*Ctr*Wraps),
//      #declare Ctr = Ctr+Increment_Val;
//  #end //end while
//}//end spline
//
//
//#declare SphereRad = .001;
//#declare NumOfSpheres = 100000;
//#declare Ctr = 0;
//#declare A_Random_Coil =
//union{
// #local Ctr = 0;
// #while (Ctr <= 1)
//   sphere {
//     MySpline(Ctr),SphereRad
//     pigment { rgb <1-Ctr,Ctr,0> }
//     }
//   #ifdef(LastSpot)
//        cylinder{
//          MySpline(LastSpot),MySpline(Ctr), SphereRad
//          pigment { rgb <1-Ctr,Ctr,0> }
//        }
//   #end //end ifdef
//   #local LastSpot = Ctr;
//   #local Ctr = Ctr + 1/NumOfSpheres;
// #end
//} //end union
//
//
//#object{A_Random_Coil}

// 
********************************************************************************

#declare MyRand = seed(0);
#local TheHeight = 1;
#local Wiggliness = .2; //it's a scale factor

#local GridLength_X = 7;
#local GridLength_Z = 7;
#local GridDiv_X = 10;
#local GridDiv_Z = 10;
#local Ctr_X = 0;
#local Ctr_Z = 0;


#declare SphereRad = .01;
#declare NumOfSpheres = 10;
#declare CtrS = 0;

#declare TheBigGrid =
union{
   #local Ctr_X = 0;
   #while (Ctr_X < 15)
         #local Ctr_Z = 0;
         #while (Ctr_Z < 15)
             #local MySpline =
                 spline{ cubic_spline
                         -.1,                           //pos
                         <Ctr_X*GridLength_X/GridDiv_X, //x
                         -TheHeight/10,                 //y
                         Ctr_Z*GridLength_Z/GridDiv_Z>, //z

                         0,                             //pos
                         <Ctr_X*GridLength_X/GridDiv_X, //x
                         0,                             //y
                         Ctr_Z*GridLength_Z/GridDiv_Z>, //z

                         .5,                            //pos
                         <Ctr_X*GridLength_X/GridDiv_X  //x
                         +(rand(MyRand)-.5)*Wiggliness, //x
                         TheHeight/2,                   //y
                         Ctr_Z*GridLength_Z/GridDiv_Z   //z
                         +(rand(MyRand)-.5)*Wiggliness> //z

                         1,                             //pos
                         <Ctr_X*GridLength_X/GridDiv_X  //x
                         +(rand(MyRand)-.5)*Wiggliness, //x
                         TheHeight,                     //y
                         Ctr_Z*GridLength_Z/GridDiv_Z   //z
                         +(rand(MyRand)-.5)*Wiggliness> //z

                         1.1,                           //pos
                         <Ctr_X*GridLength_X/GridDiv_X  //x
                         +(rand(MyRand)-.5)*Wiggliness, //x
                         TheHeight*1.1                  //y
                         Ctr_Z*GridLength_Z/GridDiv_Z   //z
                         +(rand(MyRand)-.5)*Wiggliness> //z


                       }//end spline


                       union{
                       #local CtrS = 0;
                       #while (CtrS <= 1)
                         sphere {
                           MySpline(CtrS),SphereRad
                           pigment {rgb <1-CtrS,CtrS,0>}
                           }
                         #ifdef(LastSpot)
                              cylinder{
                                MySpline(LastSpot),
                                MySpline(CtrS),
                                SphereRad
                                pigment {rgb <1-CtrS,CtrS,0>}
                              }
                         #end //end ifdef
                         #local LastSpot = CtrS;
                         #local CtrS = CtrS + 1/NumOfSpheres;
                       #end
                      } //end union
                      #undef LastSpot
                      sphere{MySpline(1),
                            SphereRad*7
                            pigment{rgb <1,1,0>}
                      } //end sphere



                 #local Ctr_Z = Ctr_Z + 1;
         #end //end #while (Ctr_Z < 15)
         #local Ctr_X = Ctr_X + 1;
   #end //end #while (Ctr_X < 15)
} //end union TheBigGrid

object{TheBigGrid
        translate <-GridLength_X/2,0,-GridLength_Z/2>
        rotate y*50
}



//          /
//****   o-/--   ************************
//        o


Post a reply to this message

From: Charles C
Subject: Re: how to create a random coil
Date: 19 Oct 2007 21:51:33
Message: <47195f25@news.povray.org>
PS I'd meant to put #while (Ctr_X < GridDiv_X) instead of #while (Ctr_X 
< 15).  Same for Z.


Post a reply to this message

From: zj905
Subject: Re: how to create a random coil
Date: 19 Oct 2007 22:45:01
Message: <web.47196b8b144555e34f7090800@news.povray.org>
You are a really expert!! Admire! Thanks.
If I have new problem, where can I find you?

Charles C <"nospam a nospam.com"> wrote:
> PS I'd meant to put #while (Ctr_X < GridDiv_X) instead of #while (Ctr_X
> < 15).  Same for Z.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: how to create a random coil
Date: 19 Oct 2007 23:38:57
Message: <47197851$1@news.povray.org>

> Anybody knows how to draw a random coil in povray? I am very interested in
> doing this but not capable of doing it. I need help. Thanks in advance.
> 
> 
Your question isn't Windows-specific; ask in povray.general. You'd get 
more help.


Post a reply to this message

From: St 
Subject: Re: how to create a random coil
Date: 20 Oct 2007 00:10:40
Message: <47197fc0@news.povray.org>
"zj905" <zj9### [at] hotmailcom> wrote in message 
news:web.471937b9144555e34849a21c0@news.povray.org...
>I am doing some work on chemistry. The random coil looks like... It is
> better to give a sample. Please see this picture:
> http://www.psc.edu/science/Darden/bpti_spline_dense2.GIF. In this graph,
> the white-yellow chains are random coils. How to draw that? Thanks.
>

    Heh, ok, that's way out of my league! :) Oh, look, there's Charles, he 
knows what he's doing... :)

     Good luck, and post an image in pov.binaries.images when you're done, 
I'd love to see the end result.

     ~Steve~


Post a reply to this message

From: zj905
Subject: Re: how to create a random coil
Date: 20 Oct 2007 11:05:00
Message: <web.471a184f144555e34f7090800@news.povray.org>
Image posted.

"St." <dot### [at] dotcom> wrote:
> "zj905" <zj9### [at] hotmailcom> wrote in message
> news:web.471937b9144555e34849a21c0@news.povray.org...
> >I am doing some work on chemistry. The random coil looks like... It is
> > better to give a sample. Please see this picture:
> > http://www.psc.edu/science/Darden/bpti_spline_dense2.GIF. In this graph,
> > the white-yellow chains are random coils. How to draw that? Thanks.
> >
>
>     Heh, ok, that's way out of my league! :) Oh, look, there's Charles, he
> knows what he's doing... :)
>
>      Good luck, and post an image in pov.binaries.images when you're done,
> I'd love to see the end result.
>
>      ~Steve~


Post a reply to this message

From: zj905
Subject: Re: how to create a random coil
Date: 22 Oct 2007 14:55:00
Message: <web.471cf175144555e34849a21c0@news.povray.org>
A follow-up question:
If the chain collapsed onto the surface, how to describe it? The collapse is
not meaning lay down flat on the surface. In chemistry, this process is
called "coil-to-globule"
transition.http://images.google.com/imgres?imgurl=http://people.clarkson.edu/~sminko/nanostructured/responsive-smart-ma
terials/images/Single-Molecule-Under-Water.jpg&imgrefurl=http://people.clarkson.edu/~sminko/nanostructured/responsive-s
mart-materials/single-molecule.html&h=406&w=210&sz=25&hl=en&start=3&um=1&tbnid=7czUs9_DbTuIhM:&tbnh=124&tbnw=64&prev=/i
mages%3Fq%3Dcoil-to-globule%26svnum%3D10%26um%3D1%26hl%3Den%26rlz%3D1B2GGFB_enUS224%26sa%3DN

"zj905" <zj9### [at] hotmailcom> wrote:
> Image posted.
>
> "St." <dot### [at] dotcom> wrote:
> > "zj905" <zj9### [at] hotmailcom> wrote in message
> > news:web.471937b9144555e34849a21c0@news.povray.org...
> > >I am doing some work on chemistry. The random coil looks like... It is
> > > better to give a sample. Please see this picture:
> > > http://www.psc.edu/science/Darden/bpti_spline_dense2.GIF. In this graph,
> > > the white-yellow chains are random coils. How to draw that? Thanks.
> > >
> >
> >     Heh, ok, that's way out of my league! :) Oh, look, there's Charles, he
> > knows what he's doing... :)
> >
> >      Good luck, and post an image in pov.binaries.images when you're done,
> > I'd love to see the end result.
> >
> >      ~Steve~


Post a reply to this message

From: zj905
Subject: Re: how to create a random coil
Date: 22 Oct 2007 15:10:00
Message: <web.471cf53b144555e34849a21c0@news.povray.org>
A good sample shows here:
http://people.clarkson.edu/~sminko/?nanostructured/responsive-smart-materials/responsive-polymer-brush.html

Is it challenging?

"zj905" <zj9### [at] hotmailcom> wrote:
> Image posted.
>
> "St." <dot### [at] dotcom> wrote:
> > "zj905" <zj9### [at] hotmailcom> wrote in message
> > news:web.471937b9144555e34849a21c0@news.povray.org...
> > >I am doing some work on chemistry. The random coil looks like... It is
> > > better to give a sample. Please see this picture:
> > > http://www.psc.edu/science/Darden/bpti_spline_dense2.GIF. In this graph,
> > > the white-yellow chains are random coils. How to draw that? Thanks.
> > >
> >
> >     Heh, ok, that's way out of my league! :) Oh, look, there's Charles, he
> > knows what he's doing... :)
> >
> >      Good luck, and post an image in pov.binaries.images when you're done,
> > I'd love to see the end result.
> >
> >      ~Steve~


Post a reply to this message

From: zozimus
Subject: Re: how to create a random coil
Date: 26 Jan 2012 11:35:00
Message: <web.4f21804b144555e35b2611dd0@news.povray.org>
I am also trying to do something similar, and to make a micelle. Did you manage
to write a code to do something like that?

"zj905" <zj9### [at] hotmailcom> wrote:
> A good sample shows here:
>
http://people.clarkson.edu/~sminko/?nanostructured/responsive-smart-materials/responsive-polymer-brush.html
>
> Is it challenging?
>
> "zj905" <zj9### [at] hotmailcom> wrote:
> > Image posted.
> >
> > "St." <dot### [at] dotcom> wrote:
> > > "zj905" <zj9### [at] hotmailcom> wrote in message
> > > news:web.471937b9144555e34849a21c0@news.povray.org...
> > > >I am doing some work on chemistry. The random coil looks like... It is
> > > > better to give a sample. Please see this picture:
> > > > http://www.psc.edu/science/Darden/bpti_spline_dense2.GIF. In this graph,
> > > > the white-yellow chains are random coils. How to draw that? Thanks.
> > > >
> > >
> > >     Heh, ok, that's way out of my league! :) Oh, look, there's Charles, he
> > > knows what he's doing... :)
> > >
> > >      Good luck, and post an image in pov.binaries.images when you're done,
> > > I'd love to see the end result.
> > >
> > >      ~Steve~


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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