POV-Ray : Newsgroups : povray.newusers : DNA creation help? : Re: DNA creation help? Server Time
30 Jul 2024 08:22:41 EDT (-0400)
  Re: DNA creation help?  
From: Mike Williams
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

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