POV-Ray : Newsgroups : povray.advanced-users : Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS Server Time
26 Nov 2024 15:37:32 EST (-0500)
  Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS (Message 1 to 6 of 6)  
From: Eitan Tal
Subject: Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS
Date: 25 Feb 2000 16:48:58
Message: <38B6F838.6F69F2E9@netvision.net.il>
Hi! I wanted to know how to make somehting like a torus, but instead of
being O, I need ~
I will also like to know how they made these beautifull jewlery at the
documentation...

Did they use Sin?


Post a reply to this message

From: Margus Ramst
Subject: Re: Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS
Date: 25 Feb 2000 19:13:37
Message: <38B71B29.AA075F04@peak.edu.ee>
With a bit of trig, you can do this by stringing clipped torii.

Margus

Eitan Tal wrote:
> 
> Hi! I wanted to know how to make somehting like a torus, but instead of
> being O, I need ~
> I will also like to know how they made these beautifull jewlery at the
> documentation...
> 
> Did they use Sin?


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS
Date: 25 Feb 2000 20:40:27
Message: <38B72E00.68A8BA92@hotmail.com>
Eitan Tal wrote:

> Hi! I wanted to know how to make somehting like a torus, but instead of
> being O, I need ~
> I will also like to know how they made these beautifull jewlery at the
> documentation...
>
> Did they use Sin?

Hi !

Regarding torus-strings: Is this wat you need? (see POV-file below)

Regards
Tor Olav Kristensen

mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html

// ===================================================================
// "String" of torus segments ~~~~~~
// Copyright 2000 by Tor Olav Kristensen.
// ===================================================================

#version 3.1;
#include "colors.inc"

// ===================================================================

#declare Origo = <0, 0, 0>;
#declare Nullv = <0, 0, 0>;
#declare Unitv = <1, 1, 1>;

// ===================================================================
// Just some of my macros

#macro vCos(UU, VV)
// Returns cosinus of the angle between two vectors

  (vdot(UU, VV)/(vlength(UU)*vlength(VV)))

#end // macro vCos


#macro vangle(UU, VV)
// Returns the angle in radians between two vectors
// 0 <= angle < pi/2

  acos(vCos(UU, VV))

#end // macro vangle


#macro VectorAngles(Vector)
// Returnes two angles.
// The first is the angle between Vector and the Y-axis
// The second is the angle between the projection
// of Vector to the XZ-plane and the X-axis

  #local VAngles = Nullv;
  #if (vlength(Vector) > 0)
    #local VAngles = y*vangle(Vector, y);
    #if (VAngles.y > 0)
      #local tmp = vangle(<Vector.x, 0, Vector.z>, x);
      #if (Vector.z < 0)
        #local tmp = -tmp;
      #end
      #local VAngles = VAngles + tmp*x;
    #end
  #end // if

  VAngles

#end // macro VectorAngles


#macro vtilt(Thing, TiltVector)
// Returns the object Thing "tilted" in the direction of
// TiltVector

  #local RotateAngles = VectorAngles(TiltVector);

  object {
    Thing
    rotate  degrees(RotateAngles.x)*y
    rotate -degrees(RotateAngles.y)*z
    rotate -degrees(RotateAngles.x)*y
  }

#end // macro vtilt


#macro TorusSegment(Centerpoint, Point1, Point2, SmallRadius)
// A segment of a torus that has Centerpoint as its
// center is returned.
// The torus is cut off by two planes:
// Both these planes are perpendicular to the plane
// that Centerpoint, Point1 and Point2 are in.
// The plane that Centerpoint, Point1 and Point2 lies
// in has the normal vector: VectorUp

// Point1 and the following two direction vectors
// describes the  first plane: VectorUp and Vector1

// Point2 and the following two direction vectors
// describes the second plane: VectorUp and Vector2

  #local Vector1 = Point1-Centerpoint;
  #local Vector2 = Centerpoint-Point2;
  #local VectorUp = vcross(Vector2, Vector1);
  #local BigRadius = vlength(Vector1); // or Vector2

  intersection {
    vtilt(torus { BigRadius, SmallRadius }, VectorUp)
    plane { vcross(Vector1, VectorUp), 0 }
    plane { vcross(Vector2, VectorUp), 0 }
    translate Centerpoint
  }

#end // macro TorusSegment

// ===================================================================
// Here the fun starts

#declare V1 = <2, 3, -1>;
#declare V2 = vlength(V1)*vnormalize(<4, 7, 9>);

#declare CPt1 = Origo-4*V2+2*V1; // Center of 1. torus segment
#declare Pt11 = CPt1 + V1*2;     // Start of 1. torus segment
#declare Pt12 = CPt1 + V2*2;     // End of 1. torus segment

#declare Pt21 = Pt12;            // Start of 2. torus segment
#declare CPt2 = Pt21+V2/3;       // Center of 2. torus segment
#declare Pt22 = CPt2-V1/3;       // End of 2. torus segment

#declare Pt31 = Pt22;            // Start of 3. torus segment
#declare CPt3 = Pt31-V1/3*2;       // Center of 3. torus segment
#declare Pt32 = CPt3+V2/3*2;       // End of 3. torus segment

#declare Pt41 = Pt32;            // Start of 4. torus segment
#declare CPt4 = Pt41+V2;         // Center of 4. torus segment
#declare Pt42 = CPt4-V1;         // End of 4. torus segment

/*
#declare V3 = vcross(V1, V2);
#declare V4 = vcross(V2, V3);
#declare V5 = V3-V2/2;
#declare V6 = V4-4*V3;

#declare R = 2;
#declare Pt51 = Pt32;                  // Start of 5. torus segment
#declare CPt5 = Pt51+R*vnormalize(V5); // Center of 5. torus segment
#declare Pt52 = CPt5-R*vnormalize(V6); // End of 5. torus segment
*/

// ===================================================================
// And then we visualize it all

#declare sr = 0.5; // sphere radius
#declare cr = 0.2; // cylinder radius
#declare tr = 0.4; // torus radius

union {
  sphere { Pt11, sr }
  sphere { Pt12, sr }
  sphere { Pt21, sr }
  sphere { Pt22, sr }
  sphere { Pt31, sr }
  sphere { Pt32, sr }
  sphere { Pt41, sr }
  sphere { Pt42, sr }
//  sphere { Pt51, sr }
//  sphere { Pt52, sr }
  pigment { color Yellow }
}

union {
  sphere { CPt1, sr }
  sphere { CPt2, sr }
  sphere { CPt3, sr }
  sphere { CPt4, sr }
//  sphere { CPt5, sr }
  pigment { color Cyan }
}

union {
  cylinder { CPt1, Pt11, cr }
  cylinder { CPt1, Pt12, cr }
  cylinder { CPt2, Pt21, cr }
  cylinder { CPt2, Pt22, cr }
  cylinder { CPt3, Pt31, cr }
  cylinder { CPt3, Pt32, cr }
  cylinder { CPt4, Pt41, cr }
  cylinder { CPt4, Pt42, cr }
//  cylinder { CPt5, Pt51, cr }
//  cylinder { CPt5, Pt52, cr }
  pigment { color Green }
}

union {
  TorusSegment(CPt1, Pt11, Pt12, tr)
  TorusSegment(CPt2, Pt21, Pt22, tr)
  TorusSegment(CPt3, Pt31, Pt32, tr)
  TorusSegment(CPt4, Pt41, Pt42, tr)
//  TorusSegment(CPt5, Pt51, Pt52, tr)
  pigment { color Red }
}


// ===================================================================

light_source {  100*<1,-1,  0>, White }
light_source {  100*Unitv,  White }


camera {
  location <10, -2, 2>
  look_at (Pt31+Pt32)/2
}

background { color White }

// ===================================================================


Post a reply to this message

From: Bob Hughes
Subject: Re: Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS
Date: 25 Feb 2000 21:33:19
Message: <38b73b6f@news.povray.org>
This is one way.  I just messed around to get it right for this example of it,
and it does use only sin for the waviness.

light_source { <0,1,-10> color rgb <1.5,1.5,1.5>}
camera {
  location  <0,0,-5>
  angle 30
  look_at   <0,0,0>
}

background {rgb .5}

#declare Curve=.25; // amount of curvature [higher is larger]

#declare C=360;
#declare c=0;

#while (C>0)

#declare c=c+(1/360);

// blob { threshold .1 // slower
sphere {0,.1 // ,1 // for blob
        translate -1*z rotate C*y
        translate (sin(c * 4 * pi)*Curve)*y
   pigment {rgb <c,1-c,.5+c/2>}
  }
//  pigment {rgb 1} // for blob
// } // for blob

#declare C=C-1;

#end


Bob

"Eitan Tal" <eit### [at] netvisionnetil> wrote in message
news:38B6F838.6F69F2E9@netvision.net.il...
| Hi! I wanted to know how to make somehting like a torus, but instead of
| being O, I need ~
| I will also like to know how they made these beautifull jewlery at the
| documentation...
|
| Did they use Sin?
|


Post a reply to this message

From: Nieminen Juha
Subject: Re: Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS
Date: 26 Feb 2000 13:48:02
Message: <38b81fe2@news.povray.org>
#version unofficial MegaPov 0.4;

camera { location <-5,1,-4>*3 look_at 0 angle 35 }
light_source { <0,100,-100> 1 }
plane { y,-2 pigment { checker rgb 1, rgb .5 } }

isosurface
{ function { sqr(y+sin(x))+sqr(z)-1 }
  contained_by { box { <-50,-2,-1><50,2,1> } }
  pigment { rgb x } finish { specular .5 }
}

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Snakes, Sinus shapes, chains (like in the povray documentaion) using SINUS
Date: 27 Feb 2000 13:20:34
Message: <slrn8biqqb.v8.ron.parker@parkerr.fwi.com>
On Sat, 26 Feb 2000 02:15:37 +0200, Margus Ramst wrote:
>With a bit of trig, you can do this by stringing clipped torii.

Without the trig, you can do it using my torus spline macro, 
available at the "my other stuff" address below.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

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