📄 morphingmesh.html
字号:
<!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:35 EET 2003 -->
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>
MorphingMesh (Mobile 3D Graphics API (M3G))
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.m3g.MorphingMesh,MorphingMesh class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="MorphingMesh (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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MorphingMesh.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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">
<A HREF="../../../javax/microedition/m3g/Mesh.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/microedition/m3g/Node.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>
<A HREF="MorphingMesh.html" TARGET="_top"><B>NO FRAMES</B></A>
<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: NESTED | <A HREF="#fields_inherited_from_class_javax.microedition.m3g.Node">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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 MorphingMesh</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.MorphingMesh</B>
</PRE>
<HR>
<DL>
<DT>public class <B>MorphingMesh</B><DT>extends <A HREF="../../../javax/microedition/m3g/Mesh.html">Mesh</A></DL>
<P>
<p>A scene graph node that represents a vertex morphing polygon mesh.</p><p>MorphingMesh is equivalent to an ordinary Mesh, except that the verticesthat are rendered are computed as a weighted linear combination of the baseVertexBuffer and a number of <i>morph target</i> VertexBuffers. The resultantmesh is only used for rendering, and is not exposed to the application. Thestructure of a MorphingMesh object is shown in the figure below.</p><center><img src="./doc-files/MorphingMesh-components.png"/></center><h3>Morph targets</h3><p>All morph targets must have the same properties: The same types of arrays,the same number of vertices in each array, the same number of components pervertex, and the same component size. For example, it is prohibited for onemorph target to contain vertex coordinates and texture coordinates, if someother target only contains vertex coordinates. Similarly, having 2D texturecoordinates in one morph target and 3D texture coordinates in another is notallowed.</p><p>The base mesh must be a "superset" of the morph targets. If an array withcertain type and dimensions exists in the morph targets, a similar array mustalso exist in the base mesh, but not vice versa. It is illegal, for example,for the morph targets to have per-vertex colors and 8-bit coordinates if thebase mesh has 16-bit coordinates and/or no colors.</p><p>Only the VertexBuffer default color and the arrays that are presentin the morph targets are actually morphed. The other arrays, as wellas the scale and bias values, are copied from the base mesh. Scale andbias values of the morph targets are ignored.</p><h3>Morphing equation</h3><p>Denoting the base mesh with <b>B</b>, the morph targets with<b>T<sub>i</sub></b>, and the weights corresponding to the morphtargets with w<sub>i</sub>, the resultant mesh <b>R</b> is computedas follows:</p><ul><b>R</b> = <b>B</b> + sum [ w<sub>i</sub> (<b>T</b><sub>i</sub> - <b>B</b>) ]</ul><p>Any values for the weights w<sub>i</sub> are accepted, includingnegative values. The sum of the weights is similarly unconstrained.This allows having, for example, a model of a face with a neutralexpression as the base mesh, and two morph targets where one is thebase mesh but with a smiling mouth and the other with raised eyebrows.Now, setting the first weight to 1.0 makes the face smile, -0.5 couldmake it frown, and so on, while the eyebrow raising and lowering canbe driven independent of the mouth movements.</p><p>Setting up the morph weights such that the individual weights aswell as their sum are between [0, 1] ensures that the resultant meshnever grows beyond the convex hull of the base mesh and the targets.That, on the other hand, guarantees that no arithmetic overflows willoccur and the results are as expected.</p><p>If the application chooses to set up the weights such that they ortheir sum is not in the [0, 1] interval, it should by some other meansensure that the morphed attributes of the resultant mesh will fit intothe original numeric range, that is, in the same number of bits thatare used in the base mesh and the morph targets. The available rangefor the results can be either [0, 255] or [0, 65535], for 8-bit and16-bit components respectively. If the values do not, however, fit inthat range, the results are undefined when rendering or picking.</p><p>Any intermediate values produced during morphing are subject to the<a href="package-summary.html#NumericRange">dynamic range constraints</a>that are specified in the package description. In other words, individualweights can be very large or small, as long as the resultant mesh fits inthe 8/16-bit range.</p><p>The VertexBuffer scale and bias for the resultant mesh are takenfrom the base mesh as such, without interpolation, because correctinterpolation between (integer) values that are in different (floatingpoint) scales would require the interpolants to be first multipliedwith the scale factor, and only then interpolated. This involvesseveral floating point operations per vertex attribute, which wouldmake morphing of anything but the most trivial meshes prohibitivelyexpensive on current mobile hardware, for very little benefit. Notealso that interpolating the scale terms separately from the valueswould not produce the correct results.</p><h3>Deferred exceptions</h3><p>Any special cases and exceptions that are defined for Mesh also apply for
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -