POV-Ray : Newsgroups : povray.general : Windows 95 query : Re: Mobius Strip help Server Time
13 Aug 2024 13:20:12 EDT (-0400)
  Re: Mobius Strip help  
From: John VanSickle
Date: 20 Oct 1998 20:25:25
Message: <362D26F0.24292DD4@erols.com>
Colm Hayden wrote:
> 
> Hi all, could anyone please help me.
> 
> I would like (desperatley need) to render a mobius strip in POV-Ray but
> can't figure out how. Does anyone know? Any help greatly appreciated.
> 
> The equation for a Mobius Strip is :
> 
> The mobius strip in 3 dimensions can be represented parameterically
> f(s,t) as follows
> 
> x = cos(s) + t * cos(s/2) * cos(s)
> y = sin(s) + t * cos(s/2) * sin(s)
> z = t * sin(s/2)
> 
> where s ranges from 0 to 2*pi and t ranges typically from -0.3 to 0.3.

Try this:

#local R1=x;
#local R2=5*x;
#local N=y;

mesh {
#local Angle=0;
#while (Angle<360)
#local Angl2=Angle+5; // or whatever increment you want

smooth_triangle {
  vrotate(R2+*vrotate( R1,z*Angle/2),Angle*y),
  vrotate(vrotate(N,z*Angle/2),Angle*y),
  vrotate(R2+*vrotate(-R1,z*Angle/2),Angle*y),
  vrotate(vrotate(N,z*Angle/2),Angle*y),
  vrotate(R2+*vrotate(-R1,z*Angl2/2),Angl2*y)
  vrotate(vrotate(N,z*Angl2/2),Angl2*y)
}
smooth_triangle {
  vrotate(R2+*vrotate( R1,z*Angle/2),Angle*y),
  vrotate(vrotate(N,z*Angle/2),Angle*y),
  vrotate(R2+*vrotate( R1,z*Angl2/2),Angl2*y),
  vrotate(vrotate(N,z*Angl2/2),Angl2*y),
  vrotate(R2+*vrotate(-R1,z*Angl2/2),Angl2*y)
  vrotate(vrotate(N,z*Angl2/2),Angl2*y)
}
#local Angle=Angl2;
#end
}

-- 
"Have the manners not to be hittin' the man until he's your husband, and
entitled to hit back!"


Post a reply to this message

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