POV-Ray : Newsgroups : povray.general : Spherical Iris? Server Time
19 Nov 2024 15:27:48 EST (-0500)
  Spherical Iris? (Message 1 to 6 of 6)  
From: Timothy R  Cook
Subject: Spherical Iris?
Date: 22 Feb 2002 00:56:07
Message: <3C75DD77.32191150@scifi-fantasy.com>
I'm trying to figure out how to arrage a spherical iris...any ideas?

-- 
Tim Cook
http://empyrean.scifi-fantasy.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Grey Knight
Subject: Re: Spherical Iris?
Date: 22 Feb 2002 05:03:31
Message: <3C761768.5BDE4A26@namtar.qub.ac.uk>
"Timothy R. Cook" wrote:
> 
> I'm trying to figure out how to arrage a spherical iris...any ideas?
I'm reminded of a sort of ornament/toy thing a friend of mine has. I'll
try and do a render later today to show you what I mean. Where is it to
be used? (If you don't mind)

-- 
signature{
  "Grey Knight" contact{ email "gre### [at] yahoocom" }
  site_of_week{ url "http://digilander.iol.it/jrgpov" }
}


Post a reply to this message

From: Timothy R  Cook
Subject: Re: Spherical Iris?
Date: 22 Feb 2002 05:09:54
Message: <3C7618F2.50434BB8@scifi-fantasy.com>
Grey Knight wrote:
> Where is it to be used? (If you don't mind)

I need a submarine for my ORCA scene, and because I'm having difficulty
importing other file formats, I'm building one myself.

-- 
Tim Cook
http://empyrean.scifi-fantasy.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Grey Knight
Subject: Re: Spherical Iris?
Date: 22 Feb 2002 07:05:43
Message: <3C76340B.DC65A914@namtar.qub.ac.uk>
I'm still working on it, but I need to go to a lecture now. Here's the
code for a flat iris extracted from my archives, maybe you can modify it
while I'm away.
I'll try and finish it later.

#macro ensure_vector(Input)
  Input+< 0, 0, 0>
#end

#macro rotate_to(iVector)
  #local Vector=ensure_vector(iVector);
  #if (vlength(Vector)=0)
    #warning "rotate_to:\f!WARNING! Trying to rotate onto null vector
!WARNING!\n\n"
  #end
  #if (Vector.x=0 & Vector.z=0)
    #local RotY=0;
  #else
    #local RotY=degrees(atan2(Vector.x,Vector.z));
  #end
  #local RotX=degrees(acos(vnormalize(Vector).y));
  rotate <RotX,RotY,0>
#end

#macro disc_iris(iCenter,iNormal, Radius, NumPetals, Open, UseUnion)
  //Original macro by Michael Andrews
  #declare Center=ensure_vector(iCenter);
  #declare Normal=ensure_vector(iNormal);
  intersection{
    cylinder{ -0.05*z, 0.05*z, 1 }
      #if(UseUnion)
        union{
      #else
        merge{
      #end
      #local c=0;#while(c<NumPetals)
        cylinder{ -0.01*z, 0.01*z, 1
          rotate -3*y
          translate y
          rotate 60*z
          translate -y rotate -Open*Open*120*z translate y
          rotate 360*(c/NumPetals)*z
        }
      #local c=c+1;#end
    }
    scale Radius
    rotate 90*x
    rotate_to(Normal-Center)
    translate Center
  }
#end

-- 
signature{
  "Grey Knight" contact{ email "gre### [at] yahoocom" }
  site_of_week{ url "http://digilander.iol.it/jrgpov" }
}


Post a reply to this message

From: Timothy R  Cook
Subject: Re: Spherical Iris?
Date: 22 Feb 2002 08:04:16
Message: <3C7641CD.87B5A807@scifi-fantasy.com>
Grey Knight wrote:
> Here's the code for a flat iris extracted from my archives, maybe
> you can modify it while I'm away.

Er?  Point 1: I use Moray to make my scenes, and don't really get
into hand coding...  Point 2: However, I do see some math in there
that might be helpful to have a straight explanation of what you're
doing to accomplish the task with some simple formulas (of the
'plug in this number and out comes this other number' variety)
Maybe a nice diagram...
-- 
Tim Cook
http://empyrean.scifi-fantasy.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Grey Knight
Subject: Re: Spherical Iris?
Date: 22 Feb 2002 09:19:02
Message: <3C76534A.2C090877@namtar.qub.ac.uk>
"Timothy R. Cook" wrote:
> 
> Grey Knight wrote:
> > Here's the code for a flat iris extracted from my archives, maybe
> > you can modify it while I'm away.
> 
> Er?  Point 1: I use Moray to make my scenes, and don't really get
> into hand coding...  Point 2: However, I do see some math in there
> that might be helpful to have a straight explanation of what you're
> doing to accomplish the task with some simple formulas (of the
> 'plug in this number and out comes this other number' variety)
> Maybe a nice diagram...

Sorry I forgot to say the disc_iris macro was originally written by
someone else, then dumped into my personal archives. Here's a quick
breakdown, but I have to run soon, so I can't be more specific. I'm sure
the other guys can help you analyse the transforms if you're having
trouble.

#macro disc_iris(iCenter,iNormal, Radius, NumPetals, Open, UseUnion)
//^syntax is like that of disc{}, but with 3 extra values;
// NumPetals:  integer: number of segments in iris
// Open     :  0->1   : amount by which iris is open
// UseUnion :  boolean: union petals or merge them?

  //Original macro by Michael Andrews
//^ someone else wrote this

  #declare Center=ensure_vector(iCenter);
  #declare Normal=ensure_vector(iNormal);
//^ these just make sure we hae vector values!
  intersection{
    cylinder{ -0.05*z, 0.05*z, 1 }
//^ Comment out this line to see what happens
//^ It restricts each petal to the region inside the disc
      #if(UseUnion)
        union{
      #else
        merge{
      #end
      #local c=0;#while(c<NumPetals)
        cylinder{ -0.01*z, 0.01*z, 1  //  a petal
          rotate -3*y
          translate y
          rotate 60*z
          translate -y
          rotate -Open*Open*120*z
          translate y
          rotate 360*(c/NumPetals)*z
//^ These transformations are what move the petal to it's proper
//  position. I haven't time to parse the whole thing right now,
//  but just consider each transform in turn to get a feel for what
//  they do. You could even try commenting out all but the first line,
//  render, uncomment second line, render, etc to see visually what
//  each line does.
        }
      #local c=c+1;#end
    }
    scale Radius
    rotate 90*x
    rotate_to(Normal-Center)
    translate Center
//^ these transforms just adjust the radius and position of the iris
//  to that specified. rotate_to(Vect) just rotates an object pointing
in
//  the +y direction to point in the Vect direction.
  }
#end

-- 
signature{
  "Grey Knight" contact{ email "gre### [at] yahoocom" }
  site_of_week{ url "http://digilander.iol.it/jrgpov" }
}


Post a reply to this message

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