home *** CD-ROM | disk | FTP | other *** search
- //
- // Copyright (C) 1997-2000 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- //
- // Description:
- // This proc creates a spiral centred about the origin, with a specific
- // height, radius and number of rounds/turns/cycles.
- //
- // This is done by creating a cylinder of the correct size, then
- // creating a curve-on-surface on the cylinder (which is in
- // the form of a spiral), then duplicating the curve-on-surface
- // to get a 3D spiral.
- // example:
- // spiral 5 1 10
- //
- global proc string spiral( float $ht, float $radius, float $numRounds )
-
- {
- string $cylinder[] = `cylinder -ch off -ax 0 1 0 -p 0 0 0 -r 1.0 -hr 1.0`;
- scale $radius $ht $radius $cylinder[0];
- string $cos = `curveOnSurface -d 1 -uv 0.0 0.0 -uv 1.0 ($numRounds*8.0) $cylinder[0]`;
- string $duplicatedCrv[] = `duplicateCurve -ch off $cos`;
-
- delete $cos;
- delete $cylinder[0];
-
- return $duplicatedCrv[0];
- }
-