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

📄 graphics3d.html

📁 J2ME Mobile3D API,高性能手机3D开发的api
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Graphics3D.html#setCamera(javax.microedition.m3g.Camera, javax.microedition.m3g.Transform)">setCamera</A></B>(<A HREF="../../../javax/microedition/m3g/Camera.html">Camera</A>&nbsp;camera,          <A HREF="../../../javax/microedition/m3g/Transform.html">Transform</A>&nbsp;transform)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the Camera to use in subsequent immediate mode rendering. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Graphics3D.html#setDepthRange(float, float)">setDepthRange</A></B>(float&nbsp;near,              float&nbsp;far)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the mapping of depth values from normalized device coordinates to window coordinates. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Graphics3D.html#setLight(int, javax.microedition.m3g.Light, javax.microedition.m3g.Transform)">setLight</A></B>(int&nbsp;index,         <A HREF="../../../javax/microedition/m3g/Light.html">Light</A>&nbsp;light,         <A HREF="../../../javax/microedition/m3g/Transform.html">Transform</A>&nbsp;transform)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Binds or unbinds a Light for subsequent immediate mode rendering. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/m3g/Graphics3D.html#setViewport(int, int, int, int)">setViewport</A></B>(int&nbsp;x,            int&nbsp;y,            int&nbsp;width,            int&nbsp;height)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies a rectangular viewport on the currently bound rendering target. </TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="ANTIALIAS"><!-- --></A><H3>
ANTIALIAS</H3>
<PRE>
public static final int <B>ANTIALIAS</B></PRE>
<DL>
<DD><p>A parameter to <code>bindTarget</code>, specifying that antialiasing should be turned on. The application may query from <code>getProperties</code> whether this hint is acted upon by the implementation.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.Graphics3D.ANTIALIAS">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="DITHER"><!-- --></A><H3>
DITHER</H3>
<PRE>
public static final int <B>DITHER</B></PRE>
<DL>
<DD><p>A parameter to <code>bindTarget</code>, specifying that dithering should be turned on. The application may query from <code>getProperties</code> whether this hint is acted upon by the implementation.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.Graphics3D.DITHER">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="TRUE_COLOR"><!-- --></A><H3>
TRUE_COLOR</H3>
<PRE>
public static final int <B>TRUE_COLOR</B></PRE>
<DL>
<DD><p>A parameter to <code>bindTarget</code>, specifying that true color rendering should be turned on. The application may query from <code>getProperties</code> whether this hint is acted upon by the implementation.</p>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.m3g.Graphics3D.TRUE_COLOR">Constant Field Values</A></DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="getInstance()"><!-- --></A><H3>
getInstance</H3>
<PRE>
public static final <A HREF="../../../javax/microedition/m3g/Graphics3D.html">Graphics3D</A> <B>getInstance</B>()</PRE>
<DL>
<DD><p>Retrieves the singleton Graphics3D instance that is associated with this application. The same instance will be returned every time.</p> <p>Initially, the state of the Graphics3D instance is as follows:</p>  <ul> <li>viewport : undefined (reset at <code>bindTarget</code>)</li> <li>depth range : [0, 1]</li> <li>current camera : none</li> <li>current lights : none</li> </ul>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the Graphics3D instance associated with this application</DL>
</DD>
</DL>
<HR>

<A NAME="bindTarget(java.lang.Object)"><!-- --></A><H3>
bindTarget</H3>
<PRE>
public void <B>bindTarget</B>(java.lang.Object&nbsp;target)</PRE>
<DL>
<DD><p>Binds the given Graphics or mutable Image2D as the rendering target of this Graphics3D. The type of the Graphics object depends on the Java profile that this specification is implemented on, as follows:</p>  <ul> <li><code>java.awt.Graphics</code> on profiles supporting AWT;</li> <li><code>javax.microedition.lcdui.Graphics</code> on profiles     supporting LCDUI;</li> <li>either of the above on profiles supporting both AWT and LCDUI.</li> </ul> <p>The state of this Graphics3D after calling this method will be as follows:</p>  <ul> <li>rendering target : the given Graphics or Image2D</li> <li>viewport : size of the target, or maximum size</li> <li>depth buffer : enabled</li> <li>antialiasing : disabled</li> <li>dithering : disabled</li> <li>true color : disabled</li> <li>depth range : as before</li> <li>current camera : as before</li> <li>current lights : as before</li> </ul> <p>The viewport is set such that its top left corner is at the top left corner of the target clipping rectangle, and its dimensions are equal to those of the clipping rectangle. However, if this would cause the width or height of the viewport to exceed its implementation defined maximum, the dimension in question is set to the maximum value instead. The maximum viewport size can be queried with <code>getProperties</code>.</p> <p>Note that this method will not block waiting if another thread has already bound a rendering target to this Graphics3D. Instead, it will throw an exception. Only one target can be bound at a time, and it makes no difference whether that target has been bound from the current thread or some other thread.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>target</CODE> - the Image2D or Graphics object to receive the rendered        image<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>target</code> is null<DD><CODE>java.lang.IllegalStateException</CODE> - if this Graphics3D already has a         rendering target<DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>target</code> is not         a mutable Image2D object or a Graphics object appropriate         to the underlying Java profile<DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>target</code> is an Image2D         with an internal format other than <code>RGB</code> or         <code>RGBA</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Graphics3D.html#releaseTarget()"><CODE>releaseTarget()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="bindTarget(java.lang.Object, boolean, int)"><!-- --></A><H3>
bindTarget</H3>
<PRE>
public void <B>bindTarget</B>(java.lang.Object&nbsp;target,                       boolean&nbsp;depthBuffer,                       int&nbsp;hints)</PRE>
<DL>
<DD><p>Binds the given Graphics or mutable Image2D as the rendering target of this Graphics3D. This method is identical to the simpler variant of <code>bindTarget</code>, but allows the depth buffering enable flag and the rendering quality hints to be specified. See the class description for more information on these.</p> <p>If the depth buffer is disabled, depth testing and depth writing are implicitly disabled for <i>all</i> objects, regardless of their individual CompositingMode settings.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>target</CODE> - the Image2D or Graphics object to receive the        rendered image<DD><CODE>depthBuffer</CODE> - <i>true</i> to enable depth buffering;        <i>false</i> to disable<DD><CODE>hints</CODE> - an integer bitmask specifying which rendering quality        hints to enable, or zero to disable all hints<DT><B>Throws:</B><DD><CODE>java.lang.NullPointerException</CODE> - if <code>target</code> is null<DD><CODE>java.lang.IllegalStateException</CODE> - if this Graphics3D already has a         rendering target<DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>target</code> is not         a mutable Image2D object or a Graphics object appropriate         to the underlying Java profile<DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>target</code> is an Image2D         with an internal format other than <code>RGB</code> or         <code>RGBA</code><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>hints</code> is not zero         or an OR bitmask of one or more of <code>ANTIALIAS, DITHER,         TRUE_COLOR</code><DT><B>See Also:</B><DD><A HREF="../../../javax/microedition/m3g/Graphics3D.html#releaseTarget()"><CODE>releaseTarget()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="releaseTarget()"><!-- --></A><H3>
releaseTarget</H3>
<PRE>
public void <B>releaseTarget</B>()</PRE>
<DL>
<DD><p>Flushes the rendered 3D image to the currently bound target and then releases the target. This ensures that the 3D image is actually made visible on the target that was set in <code>bindTarget</code>. Otherwise, the image may or may not become visible.</p>
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if this Graphics3D does not have a         rendering target</DL>
</DD>
</DL>
<HR>

<A NAME="setViewport(int, int, int, int)"><!-- --></A><H3>
setViewport</H3>
<PRE>
public void <B>setViewport</B>(int&nbsp;x,                        int&nbsp;y,                        int&nbsp;width,                        int&nbsp;height)</PRE>
<DL>
<DD><p>Specifies a rectangular viewport on the currently bound

⌨️ 快捷键说明

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