POV-Ray : Newsgroups : povray.newusers : How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate e= Server Time
25 Nov 2024 22:50:41 EST (-0500)
  How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate e= (Message 1 to 3 of 3)  
From: mephuser
Subject: How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate e=
Date: 21 Jan 2005 23:00:00
Message: <web.41f1cf252775d07b3d54f5180@news.povray.org>
How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate
etc?

How do I modify the code?


Post a reply to this message

From: Mike Williams
Subject: Re: How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate e=
Date: 22 Jan 2005 01:25:05
Message: <FYripHAgFf8BFwO2@econym.demon.co.uk>
Wasn't it mephuser who wrote:
>How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate
>etc?
>
>How do I modify the code?

The "scale" and "rotate" keywords work perfectly well for isosurfaces. 

To shear an isosurface you can perform variable substitution.
See <http://www.econym.demon.co.uk/isotut/substitute.htm> for the
principles involved.

Here's a sheared box. I'm using a box because it's easy to see the
effect of the shear, scale and rotation. Just replace F with the
function of your isosurface.

#declare F=function{max((y*y-1),(x*x-1),(z*z-1))}
isosurface {
  function { F(x-y/3,y,z) }
        max_gradient 3
        contained_by{sphere{0,2}}
        pigment {rgb 1}
}


You can perform scaling and rotation by substituting the variables, but
you will usually need to adjust the size of the contained_by object and
max_gradient, which is unnecessary when you use the "scale" and "rotate"
keywords.

Here's a scaled box:

#declare F=function{max((y*y-1),(x*x-1),(z*z-1))}
#declare XScale=2;
#declare YScale=1;
#declare ZScale=0.5;
isosurface {
  function { F(x/XScale, y/YScale, z/ZScale) }
        max_gradient 14
        contained_by{sphere{0,3}}
        pigment {rgb 1}
}


Here's a box rotated by 30 degrees about the y axis.

#declare F=function{max((y*y-1),(x*x-1),(z*z-1))}
#declare A=radians(30);
isosurface {
  function { F(x*cos(A)-z*sin(A), y, z*cos(A)+x*sin(A)) }
        max_gradient 4
        contained_by{sphere{0,2}}
        pigment {rgb 1}
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate e=
Date: 3 Feb 2005 12:50:54
Message: <Ix2xzAAlJmACFwxg@econym.demon.co.uk>
Wasn't it mephuser who wrote:
>How do I Perform Transformations on Isosurface, like Scale, Shear, Rotate
>etc?

I suddenly had a thought about how to do all these by variable
substitution, and have written it up in my isosurface tutorial.

<http://www.econym.demon.co.uk/isotut/substitute.htm#shear>

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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