Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 4241

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<head>
<title>Crystal Space 1.2.1: 4.10.16 Sprite3D Mesh Object</title>

<meta name="description" content="Crystal Space 1.2.1: 4.10.16 Sprite3D Mesh Object">
<meta name="keywords" content="Crystal Space 1.2.1: 4.10.16 Sprite3D Mesh Object">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="MeshObject-Spr3D"></a>
<a name="0"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="MeshObject-Spr2D.html#0" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="MeshObject-Emit.html#0" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="Using-Crystal-Space.html#0" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="MeshObject.html#0" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Working-with-Engine-Content.html#0" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="index.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="cs_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="cs_Index.html#0" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="cs_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<hr size="1">
<h3 class="subsection"> 4.10.16 Sprite3D Mesh Object </h3>

<p><em>Written by Jorrit Tyberghein,
<a href="mailto:jorrit.tyberghein@gmail.com">jorrit.tyberghein@gmail.com</a>.</em>
</p>
<p>A 3D Sprite is a complex set of 3D triangles that supports animation through
frames.
</p>
<a name="1"></a>
<h4 class="subsubheading"> Basic Structure </h4>

<p>The following <small>SCF</small> class names are used (for <code>csLoadPlugin</code>):
</p>
<ul>
<li>
Type plugin: <samp>&lsquo;crystalspace.mesh.object.sprite.3d&rsquo;</samp>
</li><li>
Loader plugin: <samp>&lsquo;crystalspace.mesh.loader.sprite.3d&rsquo;</samp>
</li><li>
Factory loader plugin: <samp>&lsquo;crystalspace.mesh.loader.factory.sprite.3d&rsquo;</samp>
</li></ul>

<p>Objects in this plugin implement the following <small>SCF</small> interfaces (get
with <code>scfQueryInterface</code>):
</p>
<ul>
<li>
<em>MeshObject</em>
<ul>
<li>
Implements <samp>&lsquo;iMeshObject&rsquo;</samp>
</li><li>
Implements <samp>&lsquo;iSprite3DState&rsquo;</samp>
</li></ul>
</li><li>
<em>MeshObjectFactory</em>
<ul>
<li>
Implements <samp>&lsquo;iMeshObjectFactory&rsquo;</samp>
</li><li>
Implements <samp>&lsquo;iSprite3DFactoryState&rsquo;</samp>
</li></ul>
</li><li>
<em>MeshObjectType</em>
<ul>
<li>
Implements <samp>&lsquo;iMeshObjectType&rsquo;</samp>
</li><li>
Implements <samp>&lsquo;iConfig&rsquo;</samp>
</li></ul>
</li></ul>

<a name="2"></a>
<h4 class="subsubheading"> Factory State Interface </h4>

<p>Use the <samp>&lsquo;iSprite3DFactoryState&rsquo;</samp> <small>SCF</small> interface to access settings for
a 3D sprite factory.  The definition of this interface can be found in
<tt>&lsquo;CS/include/imesh/sprite3d.h&rsquo;</tt> and that is also the include file you need
to include in your applications to use this plugin.  Using this interface you
can access the material, triangles, vertices, texture coordinates, normals,
frames, actions, and various other configuration parameters for a 3D
sprite factory.
</p>
<p>For frame based animation you need to access the <samp>&lsquo;iSpriteFrame&rsquo;</samp> and
<samp>&lsquo;iSpriteAction&rsquo;</samp> interfaces (defined in <tt>&lsquo;CS/include/imesh/sprite3d.h&rsquo;</tt>).
</p>
<a name="3"></a>
<h4 class="subsubheading"> Factory Loader </h4>

<dl compact="compact">
<dt> <code>&lt;material&gt;materialname&lt;/material&gt;</code></dt>
<dd><p>Material to use for the sprite.
</p></dd>
<dt> <code>&lt;frame name=&quot;framename&quot;&gt;&lt;v x=&quot;&quot; y=&quot;&quot; z=&quot;&quot; u=&quot;&quot; v=&quot;&quot; /&gt; <small class="dots">...</small></code></dt>
<dd><p>Define one frame.  A frame is a list of vertices which are specified using the
<samp>&lsquo;v&rsquo;</samp> tag.  Every vertex has a 3D position in object space and (u,v)
coordinates in the given texture (from 0 to 1).  Note that every frame needs to
have the same number of vertices.
</p></dd>
<dt> <code>&lt;action name=&quot;actionname&quot;&gt;&lt;f name=&quot;framename&quot;&gt;&lt;delay&gt;</code></dt>
<dd><p>Define one action.  An action is a list of frames.  Every frame is annotated
with the <samp>&lsquo;f&rsquo;</samp> tag which contains the name of the frame to use and a
delay.
</p></dd>
<dt> <code>&lt;t v1=&quot;&quot; v2=&quot;&quot; v3=&quot;&quot; /&gt;</code></dt>
<dd><p>Define one triangle.  The three parameters are the indices for the three
triangle vertices.
</p></dd>
<dt> <code>&lt;smooth&gt;base/frame&lt;/smooth&gt;</code></dt>
<dd><p>Defines how to apply normal smoothing on the sprite.
</p></dd>
<dt> <code>&lt;tween&gt;yes/no&lt;/tween&gt;</code></dt>
<dd><p>Set to yes if you want to enable frame tweening.  Default is false.
</p></dd>
</dl>

<a name="4"></a>
<h4 class="subsubheading"> Object State Interface </h4>

<p><samp>&lsquo;iSprite3DState&rsquo;</samp> is the <small>SCF</small> interface that you can
use to set/get settings for a 3D Sprite object. The definition of this
interface can be found in <tt>&lsquo;CS/include/imesh/sprite3d.h&rsquo;</tt> and that's also the
include file you need to include in your applications to use this plugin.
Using this interface you can access the material, blending mode (mixmode),
current frame and action, and various other configuration parameters for an
3D sprite object.
</p>
<a name="5"></a>
<h4 class="subsubheading"> Object Loader </h4>

<dl compact="compact">
<dt> <code>&lt;factory&gt;factoryname&lt;/factory&gt;</code></dt>
<dd><p>Name of the factory to use for creation of this instance.
</p></dd>
<dt> <code>&lt;mixmode&gt;&lt;mode \&gt;&lt;/mixmode&gt;</code></dt>
<dd><p>Blending mode. see section <a href="XMLServices-Mixmode.html#0">Parsing Mixmode</a>.
</p></dd>
<dt> <code>&lt;material&gt;materialname&lt;/material&gt;</code></dt>
<dd><p>Material to use for the sprite.
</p></dd>
<dt> <code>&lt;tween&gt;yes/no&lt;/tween&gt;</code></dt>
<dd><p>Set to yes if you want to enable frame tweening.  Default is false.
</p></dd>
<dt> <code>&lt;lighting&gt;yes/no&lt;/lighting&gt;</code></dt>
<dd><p>Set to yes if you want to enable lighting.  Default is true.
</p></dd>
<dt> <code>&lt;basecolor red=&quot;&quot; green=&quot;&quot; blue=&quot;&quot; /&gt;</code></dt>
<dd><p>Base color that will be added to all vertex colors. Default 0,0,0.
</p></dd>
<dt> <code>&lt;action name=&quot;actionname&quot;&gt;</code></dt>
<dd><p>The default action to use for this sprite instance.
</p></dd>
</dl>

<a name="6"></a>
<h4 class="subsubheading"> Configuration Parameters </h4>

<p>The <tt>&lsquo;sprite3d&rsquo;</tt> plugin supports the following configuration parameters
via the <samp>&lsquo;iConfig&rsquo;</samp> interface in the mesh object type plugin:
</p>
<dl compact="compact">
<dt> <code>sprlod</code></dt>
<dd><p>Set the sprite level-of-detail (<small>LOD</small>) level.
</p></dd>
<dt> <code>sprlq</code></dt>
<dd><p>Set the sprite lighting quality.
</p></dd>
</dl>


<hr size="1">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="MeshObject-Spr2D.html#0" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="MeshObject-Emit.html#0" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="Using-Crystal-Space.html#0" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="MeshObject.html#0" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="Working-with-Engine-Content.html#0" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="index.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="cs_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="cs_Index.html#0" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="cs_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
 </font>
 <br>

</p>
</body>
</html>