https://bitbucket.org/HopeSky/mars_nd2d
ActionScript | 35 lines | 31 code | 4 blank | 0 comment | 0 complexity | 96ab96ca9b79ce1fa1a29cbf15d3e397 MD5 | raw file
`````` 1package aerys.minko.example.core.threewaygradient
2{
3	import aerys.minko.render.Effect;
4	import aerys.minko.render.geometry.Geometry;
5	import aerys.minko.render.geometry.stream.IVertexStream;
6	import aerys.minko.render.geometry.stream.StreamUsage;
7	import aerys.minko.render.geometry.stream.VertexStream;
8	import aerys.minko.render.geometry.stream.format.VertexComponent;
9	import aerys.minko.render.geometry.stream.format.VertexFormat;
10	import aerys.minko.render.geometry.stream.iterator.VertexIterator;
11	import aerys.minko.render.material.Material;
12	import aerys.minko.scene.node.Mesh;
13
14	public class ThreeWayGradientExample extends MinkoExampleApplication
15	{
16		override protected function initializeScene() : void
17		{
18			super.initializeScene();
19
20			var format : VertexFormat = new VertexFormat(VertexComponent.XY, VertexComponent.RGB);
21			var vertices : VertexIterator = new VertexIterator(new VertexStream(StreamUsage.WRITE, format));
22
23			vertices[0] = {x: 0.,  y: .5,  r: 1., g: 0., b: 0.};
24			vertices[1] = {x: -.5, y: -.5, r: 0., g: 1., b: 0.};
25			vertices[2] = {x: .5,  y: -.5, r: 0., g: 0., b: 1.};
26