- 浏览: 346197 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (354)
- Flash | as3 (53)
- AIR | Starling (46)
- Android (55)
- Java (10)
- C++ (6)
- PHP (43)
- IOS (9)
- Unity3D (2)
- cocos2d-x (1)
- OpenGL (2)
- WebGL (3)
- Server (4)
- MemCache (13)
- MySql (2)
- NoSql (2)
- PhoneGap (13)
- jQuery | jQuery Mobile (14)
- javaScript | html5 | css3 (14)
- Linux (1)
- Box2D (2)
- SmartFox (1)
- Ruby (0)
- Python (2)
- Golang (11)
- Redis (1)
- 开源项目 (6)
- 游戏策划 (1)
- 云平台 (2)
- 项目管理 (6)
- 听见月光 (32)
最新评论
-
kenkao:
http://www.linuxidc.com/Linux/2 ...
解决idea编译时resources文件夹内容不自动复制到输出路径classes的问题 -
kenkao:
http://blog.csdn.net/yanwushu/a ...
解决idea编译时resources文件夹内容不自动复制到输出路径classes的问题 -
wpy126:
你这种比较根本不公平AppCan 用了多个页面,jqm内容都 ...
AppCan VS PhoneGap - 对比两大移动开发平台 -
kenkao:
zs12593 写道这个,这个
这里只是转载,建议看一下原文, ...
android游戏开发框架libgdx环境搭建 -
zs12593:
这个,这个
android游戏开发框架libgdx环境搭建
Prerequisite knowledge
Familiarity working with the Stage3D API and a basic understanding of how it is structured is required. Basic knowledge of Vertex and Fragment Shaders, and the AGAL shading language is also recommended. Before completing this tutorial, be sure to follow along with the previous tutorials in this series on Stage3D (1. How Stage3D works, 2. Vertex and Fragment Shaders, 3. What is AGAL).
Additional required other products (third-party/labs/open source)
Flex 4.5 SDK
Flash Player 11 version of the playerglobal.swc file
Flash Player 11
User level
Intermediate
Required products
- Flash Builder 4.5 for PHP Premium (Download trial)
- Flash Professional CS5.5 (Download trial)
Sample files
<script type="text/javascript"></script><script type="text/javascript"></script>
In this article you'll examine a working ActionScript application based on the Stage3D API. First you'll to learn how to properly configure a Stage3D-ready build environment. Once the sample project is set up, you'll see how to initialize Stage3D from ActionScript, and how to create and render a super simple 3D scene consisting of a single colored triangle using Stage3D.
Finally, you'll take a look at the process of applying texture mapping and you'll review a Stage3D application with a texture mapped geometry.
Setting up the build environment
When you get started building Stage3D apps, the first task involves preparing your build environment and ensuring it is properly setup.
While it's certainly possible to build Stage3D applications using the barebones Flex SDK from the command line, it is often more convenient to use an integrated tool such as Flash Builder 4.5. The steps provided in this article focus on working with Flash Builder 4.5.
Begin by downloading and installing the latest Flex 4.5 SDK (version 4.5.0.20967 or higher). The link to download the Flex 4.5 SDK is provided in the Requirements section at the beginning of this article.
Next, download and install the new Flash Player 11 version of the playerglobal.swc file linked in the Requirements section into the Flex 4.5 SDK. Copy the SWC file and paste it into the folder structure within the Flex SDK that you just downloaded:
<Flex SDK root folder>\frameworks\libs\player\11.0
Note: You'll have to manually create the "11.0" folder and then copy SWC file inside it. Rename the file to playerglobal.swc if necessary. Future versions of the SDK will include the Flash Player 11 version of playerglobal.swc file; once the updated SDK is available this extra step won't be necessary anymore.
After that, add the latest Flex 4.5 SDK that you just downloaded to your Flash Builder 4.5 environment. To do this, choose Preferences > Flash Builder > Installed Flex SDKs. Use the interface to add the new Flex 4.5 SDK.
Obviously, you'll also need to download and install Flash Player version 11, featuring Stage3D! Use the link in the Requirements section to download it and install it now, if you haven't already done so.
Now that you've set up the new Flex 4.5 SDK with the playerglobal.swc file that you just downloaded and added it to your installation of Flex Builder, you are ready to create a new ActionScript project.
You'll also need to configure your project to target SWF version 13. Open the Project Properties and click the ActionScript Compiler tab. Add an "Additional compiler arguments" input equal to "-swf-version=13" (without quotes). In the same panel, also double-check that the app is targeting Flash Player version 11.
And finally, in order for Flash Player to actually use 3D hardware acceleration, you'll need to set WMODE
equal to "direct"
. In Flash Builder, open the index.template.html file and locate the area where params
are being passed in to the SWF file. Add the following line:
params.wmode = “direct”;
The screenshot in Figure 1 illustrates where to add this line.
This display setting refers to the ActionScript targeting Flash Player. When you are building an AIR application, you'll set the renderMode
element in the app descriptor to direct
.
Build your project now just to make sure that it works and runs properly. It should simply show a blank window.
Initializing Stage3D
Now that you've set up the ActionScript app, the first thing you'll do is initialize Stage3D.
In order to perform 3D rendering, you'll need an instance of the Context3D class, which is basically going to serve as a 3D rendering surface.
So, in the constructor, add the following code:
public function HelloTriangleColored()
{
stage.stage3Ds[0].addEventListener( Event.CONTEXT3D_CREATE, initMolehill );
stage.stage3Ds[0].requestContext3D();
}
The code above simply requests a Context3D instance using the Stage3D API, and registers an event listener. When the Context3D instance is ready, the initStage3D
function is called back by the event.
As soon as initStage3D
is called, it's important to properly configure your Context3D by calling the Context3D::configureBackBuffer
method:
protected function initMolehill(e:Event):void
{
context3D = stage.stage3Ds[0].context3D;
context3D.configureBackBuffer(800, 600, 2, true);
...
}
The code above specifies that you are using an 800 x 600 pixel rendering viewport, with a minimal level of anti-aliasing (the third parameter), and creating depth and stencil buffers for this rendering surface (the fourth parameter).
Creating a colored triangle geometry
In this section you'll create some 3D geometry (the 3D object to be rendered). For this sample, you'll create the simplest geometry possible: a colored triangle.
To accomplish this, you'll need a Vertex Buffer, and you are going to specify Vertex Attributes for vertex position (x, y, z) and vertex color (r, g, b). Each vertex has 6 components. Begin by defining this Vertex Buffer data into a vector, like this:
protected function initMolehill(e:Event):void
{
...
var vertices:Vector.<Number> = Vector.<Number>([
-0.3,-0.3,0, 1, 0, 0, // x, y, z, r, g, b
-0.3, 0.3, 0, 0, 1, 0,
0.3, 0.3, 0, 0, 0, 1]);
...
}
Then, create a VertexBuffer3D instance that you can use to upload the Vertex Buffer data to the GPU.
protected var vertexbuffer:VertexBuffer3D;
...
protected function initMolehill(e:Event):void
{
...
// Create VertexBuffer3D. 3 vertices, of 6 Numbers each
vertexbuffer:VertexBuffer3D = context3D.createVertexBuffer(3, 6);
// Upload VertexBuffer3D to GPU. Offset 0, 3 vertices
vertexbuffer.uploadFromVector(vertices, 0, 3);
...
}
You'll also need an Index Buffer to define your triangle. In this case, the lone triangle will simply consist of vertices 0, 1 and 2. Similar to the Vertex Buffer, the Index Buffer must also be uploaded to the GPU. To achieve this you'll use the IndexBuffer3D class:
protected var indexbuffer:IndexBuffer3D;
...
protected function initMolehill(e:Event):void
{
...
var indices:Vector.<uint> = Vector.<uint>([0, 1, 2]);
// Create IndexBuffer3D. Total of 3 indices. 1 triangle of 3 vertices
indexbuffer = context3D.createIndexBuffer(3);
// Upload IndexBuffer3D to GPU. Offset 0, count 3
indexbuffer.uploadFromVector (indices, 0, 3);
...
}
The code above defines the geometry. Now you need both a Vertex and a Fragment Shader.
To keep it simple, you'll use the same Shader program discussed in a previous article in this series titled What is AGAL. The Vertex Shader simply transforms the vertices according to a transform matrix passed in from ActionScript, and then passes along the vertex color down the rendering pipeline to the Fragment Shader.
m44 op, va0, vc0 mov v0, va1
The Fragment Shader gets the interpolated color from its input and passes it along as output color.
mov oc, v0
You'll use AGAL Mini Assembler to assemble the Shader code into object code, and then use the Program3D API class to upload the Shader to the GPU.
protected function initMolehill(e:Event):void
{
...
var vertexShaderAssembler : AGALMiniAssembler = new AGALMiniAssembler();
vertexShaderAssembler.assemble( Context3DProgramType.VERTEX,
"m44 op, va0, vc0\n" + // pos to clipspace
"mov v0, va1" // copy color
);
var fragmentShaderAssembler : AGALMiniAssembler= new AGALMiniAssembler();
fragmentShaderAssembler.assemble( Context3DProgramType.FRAGMENT,
"mov oc, v0 "
);
program = context3D.createProgram();
program.upload( vertexShaderAssembler.agalcode, fragmentShaderAssembler.agalcode);
...
}
Rendering the scene
At this point, the scene is now ready for rendering. In this section, you'll set up a rendering loop. Just create an onRender
function that is called at every frame by an ENTER_FRAME event.
protected function onRender(e:Event):void
{
if ( !context3D )
return;
...
}
At the start of each frame render, you'll call Context3D::clear.
This clears the rendering color buffer (the surface on which the content is rendered) with a background color that we pass in (as the depth and stencil buffers associated with the Context3D get cleared). Use the code shown below to pass in a white background:
protected function onRender(e:Event):void
{
...
context3D.clear ( 1, 1, 1, 1 );
...
}
At each frame you'll have to enable the Program3D with the uploaded Shaders, as well as the VertexBuffer3D, associating the Vertex Attributes with the proper Shader Attribute Registers, as discussed in the previous article What is AGAL.
You'll also need to pass in the transform matrix, used by the Vertex Shader. Let's use a rotation matrix that varies at each frame, to let our triangle spin a little bit…
protected function onRender(e:Event):void
{
...
// vertex position to attribute register 0
context3D.setVertexBufferAt (0, vertexbuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
// color to attribute register 1
context3D.setVertexBufferAt(1, vertexbuffer, 3, Context3DVertexBufferFormat.FLOAT_3);
// assign shader program
context3D.setProgram(program);
var m:Matrix3D = new Matrix3D();
m.appendRotation(getTimer()/40, Vector3D.Z_AXIS);
context3D.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, m, true);
...
}
After setting this up, it's time to perform the actual rendering. You'll need to call the Context3D::drawTriangles
method, passing in the Index Buffer; this operation will render the triangle to the rendering surface (the color buffer).
Finally, after you are finished rendering all the 3D objects of the scene in that frame (in this example, there is only one), you'll need to call Context3D::present
. This method tells Stage3D that the app has rendered the frame and the frame is ready to be presented to the screen.
protected function onRender(e:Event):void
{
...
context3D.drawTriangles(indexbuffer);
context3D.present();
}
Run the Hello Triangle Colored application to see the finished result and take a moment to enjoy your creation (see Figure 2).
Here is the entire code sample used to create the Hello Triangle Colored application:
{
import com.adobe.utils.AGALMiniAssembler;
import flash.display.Sprite;
import flash.display3D.Context3D;
import flash.display3D.Context3DProgramType;
import flash.display3D.Context3DVertexBufferFormat;
import flash.display3D.IndexBuffer3D;
import flash.display3D.Program3D;
import flash.display3D.VertexBuffer3D;
import flash.events.Event;
import flash.geom.Matrix3D;
import flash.geom.Rectangle;
import flash.geom.Vector3D;
import flash.utils.getTimer;
[SWF(width="800", height="600", frameRate="60", backgroundColor="#FFFFFF")]
public class HelloTriangleColored extends Sprite
{
protected var context3D:Context3D;
protected var program:Program3D;
protected var vertexbuffer:VertexBuffer3D;
protected var indexbuffer:IndexBuffer3D;
public function HelloTriangleColored()
{
stage.stage3Ds[0].addEventListener( Event.CONTEXT3D_CREATE, initMolehill );
stage.stage3Ds[0].requestContext3D();
addEventListener(Event.ENTER_FRAME, onRender);
}
protected function initMolehill(e:Event):void
{
context3D = stage.stage3Ds[0].context3D;
context3D.configureBackBuffer(800, 600, 1, true);
var vertices:Vector.<Number> = Vector.<Number>([
-0.3,-0.3,0, 1, 0, 0, // x, y, z, r, g, b
-0.3, 0.3, 0, 0, 1, 0,
0.3, 0.3, 0, 0, 0, 1]);
// Create VertexBuffer3D. 3 vertices, of 6 Numbers each
vertexbuffer = context3D.createVertexBuffer(3, 6);
// Upload VertexBuffer3D to GPU. Offset 0, 3 vertices
vertexbuffer.uploadFromVector(vertices, 0, 3);
var indices:Vector.<uint> = Vector.<uint>([0, 1, 2]);
// Create IndexBuffer3D. Total of 3 indices. 1 triangle of 3 vertices
indexbuffer = context3D.createIndexBuffer(3);
// Upload IndexBuffer3D to GPU. Offset 0, count 3
indexbuffer.uploadFromVector (indices, 0, 3);
var vertexShaderAssembler : AGALMiniAssembler = new AGALMiniAssembler();
vertexShaderAssembler.assemble( Context3DProgramType.VERTEX,
"m44 op, va0, vc0\n" + // pos to clipspace
"mov v0, va1" // copy color
);
var fragmentShaderAssembler : AGALMiniAssembler= new AGALMiniAssembler();
fragmentShaderAssembler.assemble( Context3DProgramType.FRAGMENT,
"mov oc, v0"
);
program = context3D.createProgram();
program.upload( vertexShaderAssembler.agalcode, fragmentShaderAssembler.agalcode);
}
protected function onRender(e:Event):void
{
if ( !context3D )
return;
context3D.clear ( 1, 1, 1, 1 );
// vertex position to attribute register 0
context3D.setVertexBufferAt (0, vertexbuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
// color to attribute register 1
context3D.setVertexBufferAt(1, vertexbuffer, 3, Context3DVertexBufferFormat.FLOAT_3);
// assign shader program
context3D.setProgram(program);
var m:Matrix3D = new Matrix3D();
m.appendRotation(getTimer()/40, Vector3D.Z_AXIS);
context3D.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, m, true);
context3D.drawTriangles(indexbuffer);
context3D.present();
}
}
}
Applying texture mapping
The Hello Triangle Colored application that you built in the previous part of this article renders a colored triangle. The triangle's colors are specified as Vertex Attributes, which are part of the Vertex Buffer. The triangle is an example of colored geometry and the colors are specified per-vertex.
In this section you'll explore a different way to render a geometry, using a common technique called texture mapping. Texture mapping is the process of using an image (a texture) to apply it to the geometry. You can think of this texture image as though it is an illustrated piece of paper, sort of like a piece of wallpaper. Specify a triangle (or, more generally, a 3D object), and wrap this illustrated paper around the surface of the object.
Using this strategy, you can render a 3D object as if it really contains all those tiny details from the illustrated texture. In reality, the texture details are not actually part of the geometry. The visual complexity is simply illustrated details from the applied texture image.
When you apply texture mapping you'll specify the exact positions the texture elements need to be placed on top of the geometry. Basically, when you wrap the geometry around with the texture image, you need to create a precise mapping that defines exactly where each pixel of the texture image should fall on the 3D geometry.
Working with UV coordinates
The way to line up a texture on the 3D geometry involves specifying the mapping on a per-vertex basis: for each vertex you specify a pair of 2D coordinates, indicated as (U, V), that define the point of the texture image that corresponds to that specific vertex. So, these UV coordinates are specified as Vertex Attributes in the Vertex Buffer and the Vertex Shader receives them as an input stream.
Then, as it normally happens with Vertex Attributes, the Vertex Shader passes the UV coordinates out as outputs down the rendering pipeline, and the Rasterizer interpolates them (for more details, see a previous article in this series titled Vertex and Fragment Shaders). In this way, the Fragment Shader receives the proper values of the UV coordinates for each triangle Fragment (for each pixel that will be rendered). So, each pixel of each rendered triangle gets mapped to a specific pixel of the texture (also known as a texture element, or texel).
In other words, by specifying the UV coordinates, you've created a mapping between the 3D geometry and the texture image. The is the concept behind the term texture mapping.
Working with the Texture class in the Stage3D API
The Texture class in the Stage3D API includes support for applying textures.
A texture image must first be uploaded to the GPU memory in order to be used during rendering. You can use the Texture class to upload a texture image to the GPU, using the following code:
protected var texture:Texture;
...
protected function initMolehill(e:Event):void
{
...
var bitmap:Bitmap = new TextureBitmap();
texture = context3D.createTexture(bitmap.bitmapData.width, bitmap.bitmapData.height, Context3DTextureFormat.BGRA, false);
texture.uploadFromBitmapData(bitmap.bitmapData);
...
}
As discussed above, the Vertex Shader receives the UV texture coordinates as a Vertex Attribute, and passes them as output down the rendering pipeline so that they can be properly interpolated and fed to the Fragment Shader. The Vertex Shader is very similar to the the colored triangle sample project described above, except that Attribute Register 1 contains UV coordinates instead of color values.
m44 op, va0, vc0 mov v0, va1
The Fragment Shader receives the interpolated UV coordinates and uses them to sample the texture, through a Texture Sampler.
Let's imagine that the texture is associated to ActionScript to Texture Sampler 0. In this case, the Fragment Shader will be:
tex ft1, v0, fs0 <2d> mov oc, ft1
The first line of the Fragment Shader samples the texture using Texture Sampler 0 and the UV coordinates in varying register 0, and copies the result into Temporary Register 1. The second line simply copies the content of Temporary Register 1 (the sampled texture) to the output.
Modifying the Hello Triangle Colored application to apply a texture map
In this section you'll modify the previous Hello Triangle application, so that it uses texture mapping.
The first thing to update in the application is to add an image for a texture. Use the code below to import an external texture image:
[Embed( source = "RockSmooth.jpg" )]
protected const TextureBitmap:Class;
...
You'll also need to change the definition of the Vertex Buffer. Rather than passing the color Vertex Attribute, you'll provide UV coordinates:
protected function initMolehill(e:Event):void
{
...
var vertices:Vector.<Number> = Vector.<Number>([
-0.3,-0.3,0, 1, 0, // x, y, z, u, v
-0.3, 0.3, 0, 0, 1,
0.3, 0.3, 0, 1, 1]);
// Create VertexBuffer3D. 3 vertices, of 5 Numbers each
vertexbuffer = context3D.createVertexBuffer(3, 5);
// Upload VertexBuffer3D to GPU. Offset 0, 3 vertices
vertexbuffer.uploadFromVector(vertices, 0, 3);
...
}
Notice that UV coordinates are defined between 0 and 1, where (U, V) = (0, 0) means the bottom-left corner of the texture image, and (U, V) = (1, 1) means the top-right corner.
The rendering loop then enables the Texture object, and associates it to Texture Sampler 0 that is used by the Fragment Shader:
protected function onRender(e:Event):void
{
...
// assign texture to texture sampler 0
context3D.setTextureAt(0, texture);
...
}
After making these changes, run the application again to see the textured triangle displayed in the Stage3D app you created (see Figure 3).
Here's the entire code sample used to create the Hello Textured Triangle application:
package
{
import com.adobe.utils.AGALMiniAssembler;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.display3D.Context3D;
import flash.display3D.Context3DProgramType;
import flash.display3D.Context3DTextureFormat;
import flash.display3D.Context3DVertexBufferFormat;
import flash.display3D.IndexBuffer3D;
import flash.display3D.Program3D;
import flash.display3D.VertexBuffer3D;
import flash.display3D.textures.Texture;
import flash.events.Event;
import flash.geom.Matrix3D;
import flash.geom.Rectangle;
import flash.geom.Vector3D;
import flash.utils.getTimer;
[SWF(width="800", height="600", frameRate="60", backgroundColor="#FFFFFF")]
public class HelloTriangleTextured extends Sprite
{
[Embed( source = "RockSmooth.jpg" )]
protected const TextureBitmap:Class;
protected var texture:Texture;
protected var context3D:Context3D;
protected var program:Program3D;
protected var vertexbuffer:VertexBuffer3D;
protected var indexbuffer:IndexBuffer3D;
public function HelloTriangleTextured()
{
stage.stage3Ds[0].addEventListener( Event.CONTEXT3D_CREATE, initMolehill );
stage.stage3Ds[0].requestContext3D();
addEventListener(Event.ENTER_FRAME, onRender);
}
protected function initMolehill(e:Event):void
{
context3D = stage.stage3Ds[0].context3D;
context3D.configureBackBuffer(800, 600, 1, true);
var vertices:Vector.<Number> = Vector.<Number>([
-0.3,-0.3,0, 1, 0, // x, y, z, u, v
-0.3, 0.3, 0, 0, 1,
0.3, 0.3, 0, 1, 1]);
// Create VertexBuffer3D. 3 vertices, of 5 Numbers each
vertexbuffer = context3D.createVertexBuffer(3, 5);
// Upload VertexBuffer3D to GPU. Offset 0, 3 vertices
vertexbuffer.uploadFromVector(vertices, 0, 3);
var indices:Vector.<uint> = Vector.<uint>([0, 1, 2]);
// Create IndexBuffer3D. Total of 3 indices. 1 triangle of 3 vertices
indexbuffer = context3D.createIndexBuffer(3);
// Upload IndexBuffer3D to GPU. Offset 0, count 3
indexbuffer.uploadFromVector (indices, 0, 3);
var bitmap:Bitmap = new TextureBitmap();
texture = context3D.createTexture(bitmap.bitmapData.width, bitmap.bitmapData.height, Context3DTextureFormat.BGRA, false);
texture.uploadFromBitmapData(bitmap.bitmapData);
var vertexShaderAssembler : AGALMiniAssembler = new AGALMiniAssembler();
vertexShaderAssembler.assemble( Context3DProgramType.VERTEX,
"m44 op, va0, vc0\n" + // pos to clipspace
"mov v0, va1" // copy UV
);
var fragmentShaderAssembler : AGALMiniAssembler= new AGALMiniAssembler();
fragmentShaderAssembler.assemble( Context3DProgramType.FRAGMENT,
"tex ft1, v0, fs0 <2d>\n" +
"mov oc, ft1"
);
program = context3D.createProgram();
program.upload( vertexShaderAssembler.agalcode, fragmentShaderAssembler.agalcode);
}
protected function onRender(e:Event):void
{
if ( !context3D )
return;
context3D.clear ( 1, 1, 1, 1 );
// vertex position to attribute register 0
context3D.setVertexBufferAt (0, vertexbuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
// UV to attribute register 1
context3D.setVertexBufferAt(1, vertexbuffer, 3, Context3DVertexBufferFormat.FLOAT_2);
// assign texture to texture sampler 0
context3D.setTextureAt(0, texture);
// assign shader program
context3D.setProgram(program);
var m:Matrix3D = new Matrix3D();
m.appendRotation(getTimer()/40, Vector3D.Z_AXIS);
context3D.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, m, true);
context3D.drawTriangles(indexbuffer);
context3D.present();
}
}
}
Where to go from here
In this article you used the concepts learned in the previous articles in the Stage3D series, to finally drill into the core processes and create two fully working ActionScript applications based on Stage3D. Even though the sample applications just created a simple scene, consisting of a single triangle, all of the concepts of working with Stage3D are included. From here on as you experiment with building Stage3D apps, things will only get deeper and more interesting.
In the next article in the Stage3D series, you'll learn about a fundamental topic for 3D rendering: working with perspective.
In the meantime, be sure to visit the following Developer Centers to find more tutorials and sample projects:
发表评论
-
as3 中文转拼音
2017-01-03 17:27 2475private static const PinYin:Ob ... -
解决flash builder 4.6调试不可用
2016-12-19 09:47 492来自:http://blog.csdn.net/cupi ... -
ColorMatrixFilter 色彩矩阵滤镜
2016-05-20 10:34 984包 flash.filters 类 public final ... -
ANE 在 Android 上的应用
2015-01-08 17:59 970http://blog.csdn.net/linxcool ... -
as3通用三方库大全
2014-09-25 10:41 906http://wiki.junnan.org/pages/ ... -
4个不错的Flash开源项目
2014-08-15 12:02 518原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出 ... -
Flash教程:多种图片切换效果
2014-08-12 14:16 639http://www.missyuan.com/threa ... -
DragonBones快速入门指南
2014-07-17 10:46 977DragonBones快速入门指南 ... -
[Flex]Flex编程注意之自动获取焦点、监听全局键盘事件
2014-07-17 09:40 506http://www.k-zone.cn/zblog/pos ... -
使用 jsfl 发布flash IDE 插件
2014-07-16 16:59 1027http://blog.csdn.net/aosnowas ... -
as3种常见的弹性效果公式以及波形运动等as3动画效果公式代码整理
2014-07-14 09:12 988as3种常见的弹性效果公式以及波形运动等as3动画效果公式代 ... -
基于flash AS3.0 的BASE64编码与解码类
2014-07-02 13:35 693代码 Code highlighting produc ... -
FlashBuilder 4.6下载与安装
2014-06-04 17:02 4来自:http://m.oschina.net/blog/ ... -
as3绘制饼状图
2014-03-31 17:13 657来自:http://www.cnblogs.com/ddw1 ... -
Pixel Bender 浅尝
2014-03-21 17:50 779来自:http://chaimzane.iteye.com/ ... -
Flex入门的好书——《Flex3 Cookbook 中文版》
2014-01-13 13:55 836本文标题:Flex入门的好书——《Flex3 Cook ... -
MaxRects纹理合并算法as3实现
2014-01-09 17:40 3145来自:http://www.duzengqiang.com ... -
AS3之BitmapData学习整理
2013-10-24 11:05 2664http://www.cnblogs.com/ps ... -
AS3连接MYSQL数据库
2013-10-12 17:38 588原文链接:http://www.cnblogs.com/yi ... -
flash实用工具类+开源包收藏
2013-09-09 11:02 2165来自:http://blog.sina.com.cn/s/b ...
相关推荐
在Android应用开发中,"Hello Triangle"是学习OpenGL ES的典型入门教程,它通过绘制一个简单的三角形来介绍基本的渲染流程。这个过程包括设置上下文、定义顶点坐标、配置着色器以及最终将图形呈现在屏幕上。 1. **...
每个人学习OpenGL都必须走的路——使用OpenGl绘制的第一个三角形(Hello Triangle)(内含详细解释)
Hello-Triangle-01.zip
这个项目,"OpenGL-4.6-Hello-Triangle",是学习和理解OpenGL的一个经典起点,特别是它的最新版本4.6。在这个教程中,我们将探讨如何通过使用着色器来创建一个简单的三角形,这是所有现代OpenGL应用程序的基础。 ...
% 检查输入是否满足三角形条件:任意两边之和大于第三边 if a + b || a + c || b + c error('Invalid triangle: The sum of any two sides must be greater than the third side.'); end % 计算半周长 semi...
The Triangle Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 26414 Accepted: 15435 Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program...
(三角形类)设计一个扩展自抽象类GeometricObject 的新的Triangle 类。绘制Triangle 类和GeometricObject 类的UML图并实现Triangle 类。 编写一个测试程序,提示用户输入三角形的三条边、一种颜色以及一个表明该...
Triangle extends GeometricObject 设计一个名为Triangle的类来继承GeometricObject类。该类包括: 三个名为side1,side2,side3的double类型数据域来表示这个三角形的三条边,它们的默认值是1.0。 一个无参构造...
设计一个Triangle类,通过运算符重载来实现两个三角形的面积相加。 operator + (const Triangle& t1,const Triangle& t2); 如对你有用的话,希望你来下载啊。
The number of rows in the triangle is > 1 but <= 100. The numbers in the triangle, all integers, are between 0 and 99. 输出 Your program is to write to standard output. The highest sum is written as ...
在Android平台上,OpenGL ES是一种广泛使用的图形库,用于在移动设备上实现高性能的2D和3D图形...通过学习和实践`GL_TRIANGLE_STRIP`纹理贴图,开发者可以有效地创建复杂的3D模型和动画,提升Android应用的图形表现力。
三角剖分库Triangle在windows下编译的.exe .dll .lib 主要是我的原创博文的最终成果:https://blog.csdn.net/csubai07/article/details/102868479
openGLES3.0绘制三角形程序源码,包括顶点着色器、片元着色器,运行环境windows10+vs2017+Mali_OpenGL_ES_Emulator-v3.0.4-2-g8d905-Windows-64bit_unsigned
java java_leetcode题解之Largest Triangle Area.java
OpenGL是计算机图形学中广泛使用的应用编程接口(API),它允许程序员在各种操作系统上创建复杂的3D图形。在这个“gl_triangle.zip_triangle”压缩包中,我们聚焦于一个基础且重要的概念:绘制三角形。三角形在3D...
"Triangle-响应式Bootstrap模板"是一款专为适应不同设备屏幕设计的网页模板,它充分利用了Bootstrap框架的强大功能,确保在个人电脑(PC)和移动设备(mobile)上都能提供一致且优秀的用户体验。Bootstrap是一个广泛...
其中,光线与三角形的相交检测是光线追踪的核心算法之一,涉及到向量运算、平面方程和线性代数等基础知识。这个过程通常包括求解线段与平面的交点,以及判断交点是否落在三角形内。 此外,对比测试图形展示了不同的...
配置环境:windows10+vs2017+Mali_OpenGL_ES_Emulator-v3.0.4-2-g8d905-Windows-64bit_unsigned 使用openGLES3.0完美运行程序
triangle.html
使用运行 Hello Triangle 示例的示例项目 用法 克隆回购。 从内部回购,运行 lein trampoline run -m clojure.main script/brepl.clj 等待“等待浏览器连接...”出现。 将浏览器指向 localhost:9000 。 您应该...