<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>gluSphere</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="gluSphere"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluSphere — draw a sphere</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">gluSphere</b>(</code></td><td>GLUquadric*  </td><td><var class="pdparam">quad</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">radius</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">slices</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">stacks</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>quad</code></em></span></dt><dd><p>
                    Specifies the quadrics object (created with <a class="citerefentry" href="gluNewQuadric.xml"><span class="citerefentry"><span class="refentrytitle">gluNewQuadric</span></span></a>).
                </p></dd><dt><span class="term"><em class="parameter"><code>radius</code></em></span></dt><dd><p>
                    Specifies the radius of the sphere.
                </p></dd><dt><span class="term"><em class="parameter"><code>slices</code></em></span></dt><dd><p>
                    Specifies the number of subdivisions around the <span class="emphasis"><em>z</em></span> axis 
                    (similar to lines of longitude).
                </p></dd><dt><span class="term"><em class="parameter"><code>stacks</code></em></span></dt><dd><p>
                    Specifies the number of subdivisions along the <span class="emphasis"><em>z</em></span> axis
                    (similar to lines of
                    latitude).
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">gluSphere</code> draws a sphere of the given radius centered around the origin. The
            sphere is subdivided around the <span class="emphasis"><em>z</em></span> axis into slices and along the 
            <span class="emphasis"><em>z</em></span> axis 
            into stacks (similar to lines of longitude and latitude).
        </p><p>
            If the orientation is set to <code class="constant">GLU_OUTSIDE</code> 
            (with <a class="citerefentry" href="gluQuadricOrientation.xml"><span class="citerefentry"><span class="refentrytitle">gluQuadricOrientation</span></span></a>), then any normals generated 
            point away from the center of the sphere.
            Otherwise, they point toward the center of the sphere.
        </p><p>
            If texturing is turned on (with <a class="citerefentry" href="gluQuadricTexture.xml"><span class="citerefentry"><span class="refentrytitle">gluQuadricTexture</span></span></a>), then texture 
            coordinates are 
            generated so that <span class="emphasis"><em>t</em></span> ranges from 0.0 at 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:mi mathvariant="italic">z</mml:mi>
                    <mml:mo>=</mml:mo>
                    <mml:mrow>
                        <mml:mo>-</mml:mo>
                        <mml:mi mathvariant="italic">radius</mml:mi>
                    </mml:mrow>
                </mml:mrow>
            </mml:math>
            to 1.0 at 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:mi mathvariant="italic">z</mml:mi>
                    <mml:mo>=</mml:mo>
                    <mml:mi mathvariant="italic">radius</mml:mi>
                </mml:mrow>
            </mml:math>
            (<span class="emphasis"><em>t</em></span> increases linearly along longitudinal
            lines),
            and <span class="emphasis"><em>s</em></span> ranges from 0.0 at the +<span class="emphasis"><em>y</em></span> axis, to 0.25 at the 
            +<span class="emphasis"><em>x</em></span> axis, 
            to 0.5 at the \-<span class="emphasis"><em>y</em></span> axis, to 0.75 at the \-<span class="emphasis"><em>x</em></span> axis, and back to 1.0 
            at the +<span class="emphasis"><em>y</em></span> axis.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="gluCylinder.xml"><span class="citerefentry"><span class="refentrytitle">gluCylinder</span></span></a>,
            <a class="citerefentry" href="gluDisk.xml"><span class="citerefentry"><span class="refentrytitle">gluDisk</span></span></a>,
            <a class="citerefentry" href="gluNewQuadric.xml"><span class="citerefentry"><span class="refentrytitle">gluNewQuadric</span></span></a>,
            <a class="citerefentry" href="gluPartialDisk.xml"><span class="citerefentry"><span class="refentrytitle">gluPartialDisk</span></span></a>,
            <a class="citerefentry" href="gluQuadricOrientation.xml"><span class="citerefentry"><span class="refentrytitle">gluQuadricOrientation</span></span></a>,
            <a class="citerefentry" href="gluQuadricTexture.xml"><span class="citerefentry"><span class="refentrytitle">gluQuadricTexture</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>
