⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skinnedmesh.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Nov 27 13:54:36 EET 2003 -->
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>
SkinnedMesh (Mobile 3D Graphics API (M3G))
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.m3g.SkinnedMesh,SkinnedMesh class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="SkinnedMesh (Mobile 3D Graphics API (M3G))";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SkinnedMesh.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<EM><B>Nov 19, 2003</B></EM></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/m3g/RayIntersection.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/m3g/Sprite3D.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="SkinnedMesh.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT>  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT><A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.microedition.m3g.Node">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.m3g</FONT>
<BR>
Class SkinnedMesh</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../javax/microedition/m3g/Object3D.html">javax.microedition.m3g.Object3D</A>
        |
        +--<A HREF="../../../javax/microedition/m3g/Transformable.html">javax.microedition.m3g.Transformable</A>
              |
              +--<A HREF="../../../javax/microedition/m3g/Node.html">javax.microedition.m3g.Node</A>
                    |
                    +--<A HREF="../../../javax/microedition/m3g/Mesh.html">javax.microedition.m3g.Mesh</A>
                          |
                          +--<B>javax.microedition.m3g.SkinnedMesh</B>
</PRE>
<HR>
<DL>
<DT>public class <B>SkinnedMesh</B><DT>extends <A HREF="../../../javax/microedition/m3g/Mesh.html">Mesh</A></DL>

<P>
<p>A scene graph node that represents a skeletally animated polygon mesh.</p><p>Vertex positions in a SkinnedMesh can be associated with multipleseparately transforming Nodes, with a weight factor specified foreach. This enables groups of vertices to transform independently ofeach other while smoothly deforming the polygon mesh "skin" with thevertices. This style of animation is highly efficient for animatedcharacters.</p><p>A SkinnedMesh node is the parent of its skeleton group, and vice versa,the skeleton is the only child of the SkinnedMesh. In other words,<code>this.getSkeleton().getParent() == this</code>. The skeleton group andits descendants constitute a branch in the scene graph, and that branch istraversed just like any other branch during rendering and picking. Any spritesand meshes, including skinned meshes, contained in the skeleton group aretherefore rendered as usual. This allows, for example, a game character tohave a weapon in its hand, such that the weapon is a separate node that canbe easily interchanged with another.</p><p>The structure of a SkinnedMesh is shown in the figure below.</p><center><img src="./doc-files/SkinnedMesh-components.png"/></center><h3>Vertex transformation</h3><p>Each vertex is transformed once for each Node affecting it. The resultsare then blended together according to the weight factors of each node. Toget an initial idea of how this works, see the figure below. A more formaldefinition follows.</p><center><img src="./doc-files/SkinnedMesh-blending.png"/></center><p>Let us denote the set of nodes (bones) associated with a vertex by{ N<sub>1</sub>, N<sub>2</sub>, ..., N<sub>N</sub> }. Let us also denoteby <b>M</b><sub>i</sub> the transformation <i>from</i> the local coordinatesystem of node N<sub>i</sub> <i>to</i> a <i>reference coordinate system</i>.The choice of the reference coordinate system is not critical; depending onthe implementation, good choices may include the world coordinate system,the coordinate system of the SkinnedMesh node, or the coordinate system ofthe current camera. Finally, let us denote the weight associated with nodeN<sub>i</sub> as W<sub>i</sub>. The blended position of a vertex in thereference coordinate system is then:</p><blockquote>  <b>v</b>' =     sum [ w<sub>i</sub> <b>M</b><sub>i</sub> <b>B</b><sub>i</sub> <b>v</b> ]</blockquote><p>where</p><ul><li>0 &lt;= i &lt; N, where N is the number of bones    associated with <b>v</b>;</li><li><b>v</b> is the original vertex position in the source VertexBuffer;</li><li><b>B</b><sub>i</sub> is the "at rest" transformation from the SkinnedMesh  node to bone N<sub>i</sub>;</li><li><b>M</b><sub>i</sub> is the transformation from bone N<sub>i</sub> to the  chosen reference coordinate system (e.g. world coordinates);</li><li>w<sub>i</sub> is the normalized weight of bone N<sub>i</sub>, computed as  w<sub>i</sub> = W<sub>i</sub> / (W<sub>1</sub> + ... + W<sub>N</sub>).</li></ul><p>Finally, the blended vertex position <b>v</b>' is transformed fromthe chosen reference coordinate system to the camera space as usual.Note that when computing the normalized weights w<sub>i</sub>, 0 / 0 = 0.</p><p>If a vertex <b>v</b> has no transformations associated with it, asis the case for all vertices in a newly constructed SkinnedMesh, thevertex lies implicitly in the coordinate system of the SkinnedMesh nodeitself. That is, a SkinnedMesh in its initial state is equivalent to anordinary Mesh. When a vertex is explicitly associated with any bone inthe skeleton, the implicit association with the SkinnedMesh node isremoved.</p><p>The transformation of vertices is illustrated in the figure below.</p><center><img src="./doc-files/SkinnedMesh-transforms.png"/></center><h3>Deferred exceptions</h3><p>Any special cases and exceptions that are defined for Mesh alsoapply for SkinnedMesh. An extra exception case is introduced due tothe vertex indices set by <code>addTransform</code>. If any part ofthe skinned mesh is needed for picking or rendering, then every bonein that mesh must refer to a valid range of vertex indices, otherwisean IllegalStateException will be thrown. The indices cannot bevalidated until when they are actually needed, that is, when rendering

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -