POV-Ray : Newsgroups : povray.newusers : DNA creation help? Server Time
30 Jul 2024 06:28:49 EDT (-0400)
  DNA creation help? (Message 11 to 17 of 17)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Oleguer Vilella
Subject: Re: DNA creation help?
Date: 26 Oct 2004 02:26:08
Message: <417dee00$1@news.povray.org>
Yes, Ok Mike, I can't rotate the function, but why?

Thanks,
Oleguer



news:qMf### [at] econymdemoncouk...
> Wasn't it Oleguer Vilella who wrote:
> >How can I rotate it? and how can I translate it? Of I do this it gives me
an
> >error:
> >
> >====================================
> >isosurface {
> >function {  f_helix1 (x, y, z, 2, 3, 4, 5, 0.1, 1, 25) rotate x*25 }
> >        max_gradient 6
> >        contained_by {sphere {0, 1.2} }
> >        pigment {rgb .9}
> >}
> >=====================================
>
> Rotate the isosurface, not the function
>
> isosurface {
> function {  f_helix1 (x, y, z, 2, 3, 4, 5, 0.1, 1, 25)  }
>         max_gradient 6
>         contained_by {sphere {0, 1.2} }
>         rotate x*25
>         pigment {rgb .9}
> }
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: DNA creation help?
Date: 26 Oct 2004 10:19:51
Message: <wy+PzKA5zlfBFwyq@econym.demon.co.uk>
Wasn't it Oleguer Vilella who wrote:
>Yes, Ok Mike, I can't rotate the function, but why?

It just doesn't happen to be part of the standard syntax, and rotating
the isosurface does what you want, so there's not much point for someone
to take the trouble to add it.

You can achieve function transformations by substituting variables, like
this:

#declare Cos25 = cos(radians(25));
#declare Sin25 = sin(radians(25));

isosurface {
function {  f_helix1 (x-1, y*Cos25+z*Sin25, z*Cos25-y*Sin25,
            2, 3, 4, 5, 0.1, 1, 25) }
        max_gradient 6
        contained_by {sphere {x, 1.2}}
        pigment {rgb .9}
}

The "x-1" does exactly the same as a "translate x" (observe that I had
to move the "contained_by" object as well, and the syntax doesn't even
allow you to use "translate x" there either).

The "y*Cos25+z*Sin25, z*Cos25-y*Sin25" bit does the same as "rotate
x*25".

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Shurakai
Subject: Re: DNA creation help?
Date: 19 Jan 2005 10:05:01
Message: <web.41ee76ad89e84e744ccd982c0@news.povray.org>
"Akuma" <afr### [at] hotmailcom> wrote:
> I've been trying to create a strand of DNA using an isosurface. However, I
> keep having trouble creating the double helix using the function f_helix1
> found in functions.inc
>
> Could anybody give me an example double helix for me to start with? It'd be
> a big help.

There's a DNA strand included in the CrystalPOV scene template package. I
took the strand from Accelrys DS. In this program there's also a structure
data file included from a DNA strand. You can use several molecular
structure visualization programs to convert this data into a pov-ray scene
file. If You should not find it, i can send You the pov file.

Shu


Post a reply to this message

From: Paul P 
Subject: Re: DNA creation help?
Date: 20 Feb 2006 21:40:01
Message: <web.43fa7c9689e84e742c710c840@news.povray.org>
"Shurakai" <nomail@nomail> wrote:
> "Akuma" <afr### [at] hotmailcom> wrote:
> > I've been trying to create a strand of DNA using an isosurface. However, I
> > keep having trouble creating the double helix using the function f_helix1
> > found in functions.inc
> >
> > Could anybody give me an example double helix for me to start with? It'd be
> > a big help.
>
> There's a DNA strand included in the CrystalPOV scene template package. I
> took the strand from Accelrys DS. In this program there's also a structure
> data file included from a DNA strand. You can use several molecular
> structure visualization programs to convert this data into a pov-ray scene
> file. If You should not find it, i can send You the pov file.
>
> Shu

I had been thinking about creating a DNA backbone with POVray for quite a
while. With some of the information on here I came up with this that works
very nicely:

#include "functions.inc"
#include "colors.inc"

camera {
  location  <0, 0, 50>
  look_at   <0, 0.0,  0.0> }

light_source { <00,0,100> colour rgb 1 }
background { rgb <0,0,0> }

#declare double = union {
isosurface {
function {  f_helix1 (x,y,z,1,1,0.5,2,1,1,-180) }
        max_gradient 2
        contained_by {sphere {1, 20} }
        pigment {rgb <1,1,1>}
           }

isosurface {
function {  f_helix1 (x,y,z,1,1,0.5,2,1,1,-180) }
        max_gradient 2
        contained_by {sphere {1, 20} }
        pigment {rgb <1,1,1>
        }
        rotate <0,120,0>
           }
}

object {
double
}

There is one MAJOR problem. This makes a left-handed helix. DNA should be
right-handed. Does anyone know how to change this?


Post a reply to this message

From: Bob Hughes
Subject: Re: DNA creation help?
Date: 20 Feb 2006 23:58:38
Message: <43fa9dfe$1@news.povray.org>
"Paul P." <nomail@nomail> wrote in message 
news:web.43fa7c9689e84e742c710c840@news.povray.org...
> "Shurakai" <nomail@nomail> wrote:
>> "Akuma" <afr### [at] hotmailcom> wrote:
>> > I've been trying to create a strand of DNA using an isosurface. 
>> > However, I
>> > keep having trouble creating the double helix using the function 
>> > f_helix1
>> > found in functions.inc
>
> I had been thinking about creating a DNA backbone with POVray
8<---snip---8<
> There is one MAJOR problem. This makes a left-handed helix. DNA should be
> right-handed. Does anyone know how to change this?

The period (second number after x,y,z) can be negative to turn it the other 
direction. Could also use just one f_helix1 by specifying 2 as the first 
number to double the strand. And... if 2 is used for the 3rd to last number 
(said to be the type) then that will make it square for a ribbon-like 
appearance when using a 45 degree rotation as the last parameter, should 
look much like many illustrations show it.

Bob H

I just put the following example together, starting with yours, to look like 
the one I found at
http://marsprogram.jpl.nasa.gov/express/newsroom/pressreleases/20030501a_image02.html
A little more internet searching doesn't help me fix this up any better so 
I'll leave that all up to you.

Beware, this wasn't based on anything real and the rods (or whatever they 
are called officially!) are only a hack to fit the ribbons.

#declare DH = union {
isosurface {
function {  f_helix1 ( x, y/2, z, 2, -1, 0.25, 2, 2, 2, 45) }
        max_gradient 2
        contained_by {sphere {1, 20} }
        pigment {rgb <1,1,1>}
           }
#local I=-0.9;
#while (I<=1)
union {
cylinder {-x*2,-x/5,0.25 pigment {rgb <1,1,0>}}
cylinder {x/5,x*2,0.25 pigment {rgb <0,1,0>}}
rotate 90*y rotate -I*1.6*360*y
translate I*20*y
}
#local I=I+0.05;
#end
}

object {
DH
}


Post a reply to this message

From: Paul P 
Subject: Re: DNA creation help?
Date: 21 Feb 2006 11:40:00
Message: <web.43fb41c589e84e74d937d540@news.povray.org>
"Bob Hughes" <omniverse@charter%net> wrote:
> The period (second number after x,y,z) can be negative to turn it the other
> direction. Could also use just one f_helix1 by specifying 2 as the first
> number to double the strand. And... if 2 is used for the 3rd to last number
> (said to be the type) then that will make it square for a ribbon-like
> appearance when using a 45 degree rotation as the last parameter, should
> look much like many illustrations show it.
>
> Bob H

Thanks! I thought I tried putting negatives everywhere, but that certainly
works. The only issue with using the 2 in the fhelix1 function for the two
strand is that there doesn't appear to be a way to change phase of the
strands. For biological correctness, DNA has alternating major and minor
grooves (see my first example). It was simple enough to make two identical
backbones and rotate one 120 degrees to set the proper phase.

Thanks for the help.

--paul


Post a reply to this message

From: Bob Hughes
Subject: Re: DNA creation help?
Date: 21 Feb 2006 16:02:36
Message: <43fb7fec$1@news.povray.org>
"Paul P." <nomail@nomail> wrote in message 
news:web.43fb41c589e84e74d937d540@news.povray.org...
> "Bob Hughes" <omniverse@charter%net> wrote:
>> The period (second number after x,y,z) can be negative to turn it the 
>> other
>> direction. Could also use just one f_helix1 by specifying 2 as the first
>> number to double the strand.
>
> Thanks! I thought I tried putting negatives everywhere, but that certainly
> works. The only issue with using the 2 in the fhelix1 function for the two
> strand is that there doesn't appear to be a way to change phase of the
> strands. For biological correctness, DNA has alternating major and minor
> grooves (see my first example). It was simple enough to make two identical
> backbones and rotate one 120 degrees to set the proper phase.

Glad to have helped any at all.

I had a feeling it shouldn't be so symmetrical, especially after seeing all 
the variations I could find through internet searching for a picture of one. 
I chose the easiest route. Biology wasn't my favorite subject in school, 
chemistry was.  :)

Bob H


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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