Revision 25503

View differences:

tags/3D_Animation_v1_0alpha_Build_5/libraries/libGPE-OSG/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0"
2
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<groupId>org.gvsig</groupId>
6
	<artifactId>libGPE-OSG</artifactId>
7
	<packaging>jar</packaging>
8
	<version>1.1-SNAPSHOT</version>
9
	<name>libGPE-OSG</name>
10

  
11
	<parent>
12
		<groupId>org.gvsig</groupId>
13
		<artifactId>gvsig-library-base-pom</artifactId>
14
		<version>1.0-SNAPSHOT</version>
15
	</parent>
16

  
17
	<dependencies>
18
		<!--dependency>
19
			<groupId>org.gvsig</groupId>
20
			<artifactId>gpe</artifactId>
21
			<version>1.0.0</version>
22
		</dependency-->
23
		<dependency>
24
			<groupId>org.gvsig</groupId>
25
			<artifactId>libGPE</artifactId>
26
			<version>1.0-SNAPSHOT</version>
27
		</dependency>
28
		<dependency>
29
			<groupId>org.gvsig</groupId>
30
			<artifactId>libGeometries3D</artifactId>
31
			<version>1.0-SNAPSHOT</version>
32
		</dependency>
33
		<dependency>
34
			<groupId>org.gvsig.osgvp.libosgvp</groupId>
35
			<artifactId>libosgvp-core</artifactId>
36
			<version>2.1.6.6</version>
37
		</dependency>
38
		
39
	</dependencies>
40
</project>
tags/3D_Animation_v1_0alpha_Build_5/libraries/libGPE-OSG/src/test/java/org/gvsig/gpe/osg/TestOSGParser.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*  osgVP. OSG Virtual Planets.
3
*
4
* Copyright (C) 2007-2008 Infrastructures and Transports Department
5
* of the Valencian Government (CIT)
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
* MA  02110-1301, USA.
21
*
22
*/
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 Instituto de Automática e Informática Industrial, UPV.
26
*/
27

  
28

  
29
package org.gvsig.gpe.osg;
30

  
31
import java.io.FileNotFoundException;
32
import java.net.URI;
33
import java.net.URISyntaxException;
34

  
35
import junit.framework.TestCase;
36

  
37
import org.gvsig.driver.OSGDriver;
38

  
39
import org.gvsig.osgvp.util.Util;
40

  
41
public class TestOSGParser extends TestCase {
42

  
43
	public void testParseURI() {
44
		//fail("Not yet implemented");
45
	}
46

  
47
	public void testParseStream() {
48
		// TODO: This is the real work.
49
		OSGDriver osgDriver = new OSGDriver();
50
		OSGParser parser = new OSGParser("OSG","OSG File Formats Parser");
51
		try {
52
			parser.parse(osgDriver, null, Util.extractResource("/cessna.osg").toURI());
53
		} catch (FileNotFoundException e) {
54
			fail("Resource not found");
55
		}
56
//		osgDriver.getRootFeature();
57
	}
58

  
59
	public void testOSGParser() {
60
		// TODO: This is the constructor, test only for creation
61
		// or something similar.
62
//		fail("Not yet implemented");
63
	}
64

  
65
	public void testAcceptURI() {
66
		OSGParser parser = new OSGParser("OSG","OSG File Formats Parser");
67
		URI uri;
68
		try {
69
			uri = Util.extractResource("/cessna.osg").toURI();
70
			assertEquals(parser.accept(uri),true);
71
			uri = new URI("pepe.com");
72
			assertEquals(parser.accept(uri),false);
73
			
74
		} catch (FileNotFoundException e) {
75
			// TODO Auto-generated catch block
76
			fail();
77
		} catch (URISyntaxException e) {
78
			// TODO Auto-generated catch block
79
			fail();
80
		}
81
		
82
	}
83

  
84
	public void testGetFormats() {
85
		String[] formats = new String[4];
86
		OSGParser parser = new OSGParser("OSG","OSG File Formats Parser");
87
		formats[0] = "OSG";
88
		formats[1] = "3DS";
89
		formats[2] = "OBJ";
90
		formats[3] = "IVE";
91
		
92
		for(int i=0; i<formats.length; i++){
93
			
94
			assertEquals(formats[i].equals(parser.getFormats()[i]),true);
95

  
96
			
97
		}
98
	}
99

  
100
	public void testGetVersions() {
101
		String[] versions = new String[1];
102
		versions[0] = "All";
103
		OSGParser parser = new OSGParser("OSG","OSG File Formats Parser");
104

  
105
		for(int i=0; i<versions.length; i++){
106
			
107
			assertEquals(versions[i].equals(parser.getVersions()[i]),true);
108

  
109
			
110
		}
111
	}
112

  
113
}
tags/3D_Animation_v1_0alpha_Build_5/libraries/libGPE-OSG/src/main/java/org/gvsig/driver/OSGDriver.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *  osgVP. OSG Virtual Planets.
3
 *
4
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
5
 * of the Valencian Government (CIT)
6
 *
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
 * MA  02110-1301, USA.
21
 *
22
 */
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 Instituto de Automática e Informática Industrial, UPV.
26
 */
27

  
28
/**
29
 * 
30
 */
31
package org.gvsig.driver;
32

  
33
import java.awt.Color;
34
import java.awt.geom.Point2D;
35
import java.awt.image.BufferedImage;
36
import java.util.Vector;
37
import java.util.logging.Level;
38

  
39
import org.gvsig.GeometryFactory3D;
40
import org.gvsig.fmap.geom.GeometryManager;
41
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
42
import org.gvsig.geometries3D.Material;
43
import org.gvsig.geometries3D.MultiGeometry;
44
import org.gvsig.geometries3D.MultiSolid;
45
import org.gvsig.geometries3D.Point3D;
46
import org.gvsig.geometries3D.PrimitiveSet;
47
import org.gvsig.geometries3D.Solid;
48
import org.gvsig.gpe.IGPEContentHandler3D;
49
import org.gvsig.gpe.parser.GPEContentHandler;
50
import org.gvsig.osgvp.util.Util;
51

  
52
/**
53
 * @author rgaitan
54
 * 
55
 */
56
public class OSGDriver extends GPEContentHandler implements
57
		IGPEContentHandler3D {
58

  
59
	private MultiGeometry _root;
60

  
61
	@Override
62
	public Object startMultiGeometry(String id, String srs) {
63
		Util.logger.log(Level.FINEST, "Starting MultiGeometry");
64
		MultiGeometry feature = (MultiGeometry) ((GeometryFactory3D) GeometryManager
65
				.getInstance().getGeometryFactory()).createMultiGeometry(id);
66
		if (_root == null)
67
			_root = feature;
68
		return feature;
69
	}
70

  
71
	public Object startMultiSolid(String id, String srs) {
72
		Util.logger.log(Level.FINEST, "Starting MultiSolid");
73
		return (MultiSolid) ((GeometryFactory3D) GeometryManager.getInstance()
74
				.getGeometryFactory()).createMultiSolid(id);
75
	}
76

  
77
	public void endMultiSolid(Object solid) {
78
	}
79

  
80
	public Object startSolid(String id, String srs) {
81
		// Util.logger.log(Level.FINEST,"Starting Geometry");
82
		Solid geometry = (Solid) ((GeometryFactory3D) GeometryManager
83
				.getInstance().getGeometryFactory()).createSolid(id);
84
		return geometry;
85
	}
86

  
87
	public void endSolid(Object geometry) {
88
		// Util.logger.log(Level.FINEST,"Ending Geometry");
89

  
90
	}
91

  
92
	@Override
93
	public void addGeometryToMultiGeometry(Object geometry, Object multiGeometry) {
94
		// Util.logger.log(Level.FINEST,"Adding Feature to Feature");
95
		((MultiGeometry) multiGeometry)
96
				.addGeometry((AbstractPrimitive) geometry);
97
	}
98

  
99
	public void addSolidToMultiSolid(Object solid, Object multiSolid) {
100
		// Util.logger.log(Level.FINEST,"Adding Geometry to Feature");
101
		((MultiSolid) multiSolid).addSolid((Solid) solid);
102
	}
103

  
104
	public void startSolidVertexArray(Object geometry) {
105
	}
106

  
107
	public void endSolidVertexArray() {
108
	}
109

  
110
	public void startSolidNormalArray(Object geometry) {
111
	}
112

  
113
	public void endSolidNormalArray() {
114
	}
115

  
116
	public void startSolidColorArray(Object geometry) {
117

  
118
	}
119

  
120
	public void endSolidColorArray() {
121
	}
122

  
123
	public void startSolidTexCoordArray(Object geometry, int nTexCoords,
124
			int stage) {
125
	}
126

  
127
	public void endSolidTexCoordArray() {
128
	}
129

  
130
	public void addVertexToSolid(Object geometry, double x, double y, double z) {
131

  
132
		Point3D point = (Point3D) ((GeometryFactory3D) GeometryManager
133
				.getInstance().getGeometryFactory()).createPoint3D("");
134
		point.setX(x);
135
		point.setY(y);
136
		point.setZ(z);
137
		((Solid) geometry).getVertices().add(point);
138
		// Util.logger.log(Level.FINEST,"Adding Vertex");
139
	}
140

  
141
	public void addNormalToSolid(Object geometry, double x, double y, double z) {
142
		Point3D point = (Point3D) ((GeometryFactory3D) GeometryManager
143
				.getInstance().getGeometryFactory()).createPoint3D("");
144
		point.setX(x);
145
		point.setY(y);
146
		point.setZ(z);
147
		((Solid) geometry).getNormals().add(point);
148
		Util.logger.log(Level.FINEST, "Adding Normal" + point.getX());
149
	}
150

  
151
	public void addTextureToSolid(Object geometry, int stage,
152
			BufferedImage image) {
153

  
154
		((Solid) geometry).getTextures().add(stage, image);
155

  
156
	}
157

  
158
	public void setNormalBindingToSolid(Object geometry, int mode) {
159

  
160
		((Solid) geometry).setNormalBinding(mode);
161

  
162
	}
163

  
164
	public void setColorBindingToSolid(Object geometry, int mode) {
165

  
166
		((Solid) geometry).setColorBinding(mode);
167

  
168
	}
169

  
170
	public void addColorToSolid(Object geometry, float r, float g, float b,
171
			float a) {
172

  
173
		((Solid) geometry).getColors().add(convertColor(r, g, b, a));
174

  
175
	}
176

  
177
	public void addTextureCoordinateToSolid(Object geometry, double x,
178
			double y, int stage) {
179
		try {
180
			((Solid) geometry).getTexcoord().get(stage);
181
		} catch (ArrayIndexOutOfBoundsException ex) {
182
			((Solid) geometry).getTexcoord().add(stage, new Vector<Point2D>());
183
		}
184
		Point2D point = new Point2D.Double();
185
		point.setLocation(x, y);
186
		((Solid) geometry).getTexcoord().get(stage).add(point);
187

  
188
	}
189

  
190
	public MultiGeometry getRootFeature() {
191
		return _root;
192
	}
193

  
194
	public void addPrimitiveSetToSolid(Object geometry, Object primitiveSet) {
195
		((Solid) geometry).getPrimitiveSets().add((PrimitiveSet) primitiveSet);
196
	}
197

  
198
	public void addIndexToPrimitiveSet(Object primitiveSet, int i) {
199
		((PrimitiveSet) primitiveSet).getIndices().add(i);
200
	}
201

  
202
	public void endPrimitiveSet(Object primitiveSet) {
203
	}
204

  
205
	public void endPrimitiveSetIndexArray() {
206
	}
207

  
208
	public Object startPrimitiveSet(int mode, int type) {
209
		return new PrimitiveSet(mode, type);
210
	}
211

  
212
	public void startPrimitiveSetIndexArray(Object primitiveSet, int indices) {
213
		((PrimitiveSet) primitiveSet).setIndices(new Vector<Integer>());
214
	}
215

  
216
	public void addMaterialToSolid(Object solid, Object material) {
217
		((Solid) solid).setMaterial((Material) material);
218

  
219
	}
220

  
221
	public void endMaterial(Object material) {
222

  
223
	}
224

  
225
	public Object startMaterial() {
226
		Material material = new Material();
227
		return material;
228
	}
229

  
230
	public void addAmbientToMaterial(Object material, float r, float g,
231
			float b, float a) {
232

  
233
		((Material) material).setAmbient(convertColor(r, g, b, a));
234

  
235
	}
236

  
237
	public void addDiffuseToMaterial(Object material, float r, float g,
238
			float b, float a) {
239

  
240
		((Material) material).setDiffuse(convertColor(r, g, b, a));
241

  
242
	}
243

  
244
	public void addEmissionToMaterial(Object material, float r, float g,
245
			float b, float a) {
246

  
247
		((Material) material).setEmission(convertColor(r, g, b, a));
248

  
249
	}
250

  
251
	public void addShininessToMaterial(Object material, float s) {
252

  
253
		((Material) material).setShininess(s);
254

  
255
	}
256

  
257
	public void addSpecularToMaterial(Object material, float r, float g,
258
			float b, float a) {
259

  
260
		((Material) material).setSpecular(convertColor(r, g, b, a));
261

  
262
	}
263

  
264
	protected Color convertColor(float r, float g, float b, float a) {
265

  
266
		int _r, _g, _b, _a;
267

  
268
		_r = Math.min((int) (r * 255), 255);
269
		_g = Math.min((int) (g * 255), 255);
270
		_b = Math.min((int) (b * 255), 255);
271
		_a = Math.min((int) (a * 255), 255);
272

  
273
		Color color = new Color(_r, _g, _b, _a);
274

  
275
		return color;
276

  
277
	}
278

  
279
	public void addBlendingToSolid(Object solid, boolean blending) {
280

  
281
		((Solid) solid).setBlending(blending);
282

  
283
	}
284

  
285
}
tags/3D_Animation_v1_0alpha_Build_5/libraries/libGPE-OSG/src/main/java/org/gvsig/gpe/IGPEContentHandler3D.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
*  osgVP. OSG Virtual Planets.
3
*
4
* Copyright (C) 2007-2008 Infrastructures and Transports Department
5
* of the Valencian Government (CIT)
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
* MA  02110-1301, USA.
21
*
22
*/
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 Instituto de Automática e Informática Industrial, UPV.
26
*/
27

  
28

  
29
package org.gvsig.gpe;
30

  
31
import java.awt.image.BufferedImage;
32

  
33
import org.gvsig.gpe.parser.IGPEContentHandler;
34

  
35
public interface IGPEContentHandler3D extends IGPEContentHandler {
36

  
37
	public Object startSolid(String id, String srs);
38

  
39
	public void endSolid(Object solid);
40
	
41
	public Object startMultiSolid(String id, String srs);
42
	
43
	public void endMultiSolid(Object solid);
44

  
45
	public void addSolidToMultiSolid(Object solid, Object feature);
46
	
47
	public void startSolidVertexArray(Object solid);
48
	
49
	public void endSolidVertexArray();
50
	
51
	public void startSolidNormalArray(Object solid);
52

  
53
	public void endSolidNormalArray();
54
	
55
	public void startSolidColorArray(Object solid);
56

  
57
	public void endSolidColorArray();
58
	
59
	public void startSolidTexCoordArray(Object solid, int nTexCoords, int stage);
60

  
61
	public void endSolidTexCoordArray();
62

  
63
	public void addVertexToSolid(Object solid, double x, double y, double z);
64

  
65
	public void addNormalToSolid(Object solid, double x, double y, double z);
66
	
67
	public void addTextureToSolid(Object geometry, int stage, BufferedImage image);
68
	
69
	public void setNormalBindingToSolid(Object solid, int mode );
70
	
71
	public void setColorBindingToSolid(Object solid, int mode );
72

  
73
	public void addColorToSolid(Object solid, float r, float g, float b, float a);
74

  
75
	public void addTextureCoordinateToSolid(Object solid, double x, double y, int stage);
76
	
77
	public Object startPrimitiveSet(int mode, int type);
78
	
79
	public void endPrimitiveSet(Object primitiveSet);
80
	
81
	public void addPrimitiveSetToSolid(Object solid, Object primitiveSet);
82
	
83
	public void startPrimitiveSetIndexArray(Object primitiveSet, int nIndices);
84

  
85
	public void endPrimitiveSetIndexArray();
86
	
87
	public void addIndexToPrimitiveSet(Object primitiveSet, int i);
88
	
89
	public Object startMaterial();
90
	
91
	public void addMaterialToSolid(Object solid, Object material);
92
	
93
	public void endMaterial(Object material);
94
	
95
	public void addAmbientToMaterial(Object material, float r, float g, float b, float a);
96
	
97
	public void addDiffuseToMaterial(Object material, float r, float g, float b, float a);
98
	
99
	public void addSpecularToMaterial(Object material, float r, float g, float b, float a);
100
	
101
	public void addEmissionToMaterial(Object material, float r, float g, float b, float a);
102
	
103
	public void addShininessToMaterial(Object material, float s);
104
	
105
	public void addBlendingToSolid(Object solid, boolean blending);
106

  
107
}
tags/3D_Animation_v1_0alpha_Build_5/libraries/libGPE-OSG/src/main/java/org/gvsig/gpe/osg/OSGParser.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *  osgVP. OSG Virtual Planets.
3
 *
4
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
5
 * of the Valencian Government (CIT)
6
 *
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
 * MA  02110-1301, USA.
21
 *
22
 */
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 Instituto de Automática e Informática Industrial, UPV.
26
 */
27

  
28
package org.gvsig.gpe.osg;
29

  
30
import java.awt.Color;
31
import java.awt.image.BufferedImage;
32
import java.io.FileNotFoundException;
33
import java.lang.reflect.Constructor;
34
import java.net.URI;
35
import java.util.NoSuchElementException;
36
import java.util.Stack;
37
import java.util.Vector;
38
import java.util.logging.Level;
39

  
40
import org.gvsig.gpe.IGPEContentHandler3D;
41
import org.gvsig.gpe.parser.GPEParser;
42
import org.gvsig.osgvp.AutoTransform;
43
import org.gvsig.osgvp.DrawArrayLengths;
44
import org.gvsig.osgvp.Drawable;
45
import org.gvsig.osgvp.Geode;
46
import org.gvsig.osgvp.Geometry;
47
import org.gvsig.osgvp.Group;
48
import org.gvsig.osgvp.Material;
49
import org.gvsig.osgvp.Matrix;
50
import org.gvsig.osgvp.MatrixTransform;
51
import org.gvsig.osgvp.Node;
52
import org.gvsig.osgvp.PositionAttitudeTransform;
53
import org.gvsig.osgvp.PrimitiveSet;
54
import org.gvsig.osgvp.Quat;
55
import org.gvsig.osgvp.Texture2D;
56
import org.gvsig.osgvp.Vec2;
57
import org.gvsig.osgvp.Vec3;
58
import org.gvsig.osgvp.Vec4;
59
import org.gvsig.osgvp.osgDB;
60
import org.gvsig.osgvp.exceptions.node.ChildIndexOutOfBoundsExceptions;
61
import org.gvsig.osgvp.exceptions.node.LoadNodeException;
62
import org.gvsig.osgvp.exceptions.node.NodeException;
63
import org.gvsig.osgvp.exceptions.texture.TextureStageException;
64
import org.gvsig.osgvp.util.Util;
65

  
66
public class OSGParser extends GPEParser {
67

  
68
	Stack<Matrix> _transforms = new Stack<Matrix>();
69
	Vector<Stack<Texture2D>> _textures = new Vector<Stack<Texture2D>>();
70
	Stack<Material> _materials = new Stack<Material>();
71
	Stack<Boolean> _blendings = new Stack<Boolean>();
72
	private IGPEContentHandler3D _content;
73
	private String description;
74
	private String name;
75

  
76
	public OSGParser(String name, String description) {
77
		// super(name, description);
78
		this.name = name;
79
		this.description = description;
80
	}
81

  
82
	@Override
83
	public String getDescription() {
84
		// TODO Auto-generated method stub
85
		return this.description;
86
	}
87

  
88
	@Override
89
	public String getName() {
90
		// TODO Auto-generated method stub
91
		return this.name;
92
	}
93

  
94
	@Override
95
	public boolean accept(URI uri) {
96
		if ((uri.getPath().toUpperCase().endsWith("OSG"))
97
				|| (uri.getPath().toUpperCase().endsWith("3DS"))
98
				|| (uri.getPath().toUpperCase().endsWith("IVE"))
99
				|| (uri.getPath().toUpperCase().endsWith("OBJ"))) {
100
			return true;
101
		}
102
		return false;
103
	}
104

  
105
	public String[] getFormats() {
106
		String[] formats = new String[4];
107
		formats[0] = "OSG";
108
		formats[1] = "3DS";
109
		formats[2] = "OBJ";
110
		formats[3] = "IVE";
111
		return formats;
112
	}
113

  
114
	public String[] getVersions() {
115
		String[] versions = new String[1];
116
		versions[0] = "All";
117
		return versions;
118
	}
119

  
120
	@Override
121
	protected void parseStream() {
122

  
123
	}
124

  
125
	@Override
126
	protected void parseURI() {
127

  
128
		// This is a very bad hack to avoid testing hangs in Mac OS Lepard
129
		Color color = new Color(0, 0, 0, 255);
130
		// TODO remove this hack
131

  
132
		Vector<Integer> addedTextures = new Vector<Integer>();
133
		boolean addedMaterial = false;
134

  
135
		_content = (IGPEContentHandler3D) getContentHandler();
136
//		Util.logger.log(Level.FINEST, getMainFile().getPath());
137
		Node root=null;
138

  
139
		try {
140
			String os = System.getProperty("os.name");
141
			String path;
142
			if (os.toLowerCase().startsWith("windows")) {
143

  
144
				path = getMainFile().getPath().substring(1,
145
						getMainFile().getPath().length());
146
			} else {
147
				path = getMainFile().getPath();
148
			}
149
			
150
			root = osgDB.readNodeFile(path);
151
//			root = osgDB.readNodeFile(getMainFile().getPath().substring(1, getMainFile().getPath().length()));
152
			
153
		} catch (LoadNodeException e) {
154
			// TODO Auto-generated catch block
155
			e.printStackTrace();
156
			return;
157
		} catch (FileNotFoundException e) {
158
			// TODO Auto-generated catch block
159
			e.printStackTrace();
160
			return;
161
		}
162
		if (root == null)
163
//			Util.logger.log(Level.FINEST, "Cannot open"
164
//					+ getMainFile().getPath());
165
		System.out.println("error");
166
		else {
167

  
168
			Object multiGeometry;
169
			multiGeometry = _content.startMultiGeometry("", "");
170

  
171
			if (root.className().equals("Geode")) {
172

  
173
				Geode rootGeode = new Geode(root.getCPtr());
174
				Object multiSolid;
175

  
176
				multiSolid = _content.startMultiSolid("", "");
177

  
178
				_content.addGeometryToMultiGeometry(multiSolid, multiGeometry);
179

  
180
				try {
181
					addedTextures = pushTextures(rootGeode);
182
				} catch (NodeException e) {
183
				}
184
				try {
185
					addedMaterial = pushMaterial(rootGeode);
186
				} catch (NodeException e) {
187
				}
188
				
189
				_blendings.push(rootGeode.getOrCreateStateSet().getEnabledBlending());
190

  
191
				for (int i = 0; i < rootGeode.getNumDrawables(); i++) {
192

  
193
					try {
194
						parseDrawable(rootGeode.getDrawable(i), multiSolid);
195
					} catch (ChildIndexOutOfBoundsExceptions e) {
196
						e.printStackTrace();
197
						return;
198
					} catch (NodeException e) {
199
					}
200

  
201
				}
202

  
203
				_blendings.pop();
204
				_content.endMultiSolid(multiSolid);
205

  
206
			}
207

  
208
			else if (root.className().equals("Group")) {
209
				Group rootGroup;
210

  
211
				try {
212
					rootGroup = new Group(root.getCPtr());
213
				} catch (NodeException e) {
214
					// TODO Auto-generated catch block
215
					e.printStackTrace();
216
					return;
217
				}
218
				try {
219
					addedTextures = pushTextures(rootGroup);
220
				} catch (NodeException e) {
221
				}
222
				try {
223
					addedMaterial = pushMaterial(rootGroup);
224
				} catch (NodeException e) {
225
				}
226
				_blendings.push(rootGroup.getOrCreateStateSet().getEnabledBlending());
227

  
228
				//System.out.println("CHILDREN: " + rootGroup.getNumChildren());
229
				
230
				for (int i = 0; i < rootGroup.getNumChildren(); i++) {
231

  
232
					try {
233
						parseNode(rootGroup.getChild(i), multiGeometry);
234
					} catch (ChildIndexOutOfBoundsExceptions e) {
235
						e.printStackTrace();
236
						return;
237
					}
238
//					Util.logger.log(Level.FINEST, "Node parsed");
239
				}
240

  
241
				_blendings.pop();
242

  
243
			}
244

  
245
			else {
246

  
247
//				Util.logger.log(Level.FINEST,
248
//						"First parsed object must be Group or Geode");
249

  
250
			}
251

  
252
			popTextures(addedTextures);
253
			if (addedMaterial)
254
				_materials.pop();
255
			_content.endMultiGeometry(multiGeometry);
256

  
257
		}
258

  
259
	}
260

  
261
	protected void parseNode(Node node, Object parent) {
262
		// Util.logger.log(Level.FINEST, "node init");
263
		Node instance;
264
		boolean isTransform = false;
265
		boolean addedMaterial = false;
266
		Vector<Integer> addedTextures = new Vector<Integer>();
267

  
268
		try {
269

  
270
			Class<?> reflect = Class.forName("org.gvsig.osgvp."
271
					+ node.className());
272
			Constructor<?> builder = reflect
273
					.getConstructor(new Class[] { long.class });
274
			instance = (Node) builder
275
					.newInstance(new Object[] { node.getCPtr() });
276

  
277
		}
278

  
279
		catch (Exception e) {
280
			instance = new Node(node.getCPtr());
281
		}
282

  
283
		if (instance instanceof Group) {
284

  
285
			Object multiGeometry;
286
			multiGeometry = _content.startMultiGeometry("", "");
287
			_content.addGeometryToMultiGeometry(multiGeometry, parent);
288
			isTransform = pushTransform((Group) instance);
289
			try {
290
				addedTextures = pushTextures(instance);
291
			} catch (NodeException e) {
292
			}
293
			try {
294
				addedMaterial = pushMaterial(instance);
295
			} catch (NodeException e) {
296
			}
297
			if (_blendings.lastElement())
298
				_blendings.push(true);
299
			else
300
				_blendings.push(instance.getOrCreateStateSet()
301
						.getEnabledBlending());
302
			for (int i = 0; i < ((Group) instance).getNumChildren(); i++) {
303

  
304
				try {
305
					parseNode(((Group) instance).getChild(i), multiGeometry);
306
				} catch (ChildIndexOutOfBoundsExceptions e) {
307
					e.printStackTrace();
308
					return;
309
				}
310

  
311
			}
312
			if (isTransform)
313
				_transforms.pop();
314
			if (addedMaterial)
315
				_materials.pop();
316
			_blendings.pop();
317
			popTextures(addedTextures);
318
			_content.endMultiGeometry(multiGeometry);
319

  
320
		}
321

  
322
		else if (instance instanceof Geode) {
323

  
324
			Object multiSolid;
325
			multiSolid = _content.startMultiSolid("", "");
326
			_content.addGeometryToMultiGeometry(multiSolid, parent);
327
			try {
328
				addedTextures = pushTextures(instance);
329
			} catch (NodeException e) {
330
			}
331
			try {
332
				addedMaterial = pushMaterial(instance);
333
			} catch (NodeException e) {
334
			}
335
			if (_blendings.lastElement())
336
				_blendings.push(true);
337
			else
338
				_blendings.push(instance.getOrCreateStateSet()
339
						.getEnabledBlending());
340
			for (int i = 0; i < ((Geode) instance).getNumDrawables(); i++) {
341

  
342
				try {
343
					parseDrawable(((Geode) instance).getDrawable(i), multiSolid);
344
				} catch (ChildIndexOutOfBoundsExceptions e) {
345
					e.printStackTrace();
346
					return;
347
				} catch (NodeException e) {
348
				}
349

  
350
			}
351
			if (addedMaterial)
352
				_materials.pop();
353
			_blendings.pop();
354
			popTextures(addedTextures);
355
			_content.endMultiSolid(multiSolid);
356

  
357
		}
358
		// Util.logger.log(Level.FINEST, "Node parsed-0");
359
		// else Util.logger.log(Level.FINEST,instance.className() + " is not
360
		// instanceof
361
		// Group or Geode");
362

  
363
	}
364

  
365
	protected void parseDrawable(Drawable drawable, Object feature)
366
			throws NodeException {
367
		Util.logger.log(Level.FINEST, "drawable init");
368
		int t = 0;
369
		if (drawable instanceof Geometry) {
370

  
371
			int j;
372
			Object solid;
373
			solid = _content.startSolid("", "");
374
			_content.addSolidToMultiSolid(solid, feature);
375

  
376
			Matrix matrix = new Matrix();
377
			for (int i = 0; i < _transforms.size(); i++) {
378

  
379
				matrix.mult(_transforms.get(i), matrix);
380

  
381
			}
382

  
383
			// Util.logger.log(Level.FINEST, "transforms");
384

  
385
			Vector<Vec3> vertices = ((Geometry) drawable).getVertexArray();
386
			if (vertices == null)
387
				vertices = new Vector<Vec3>();
388
			Vec3 vertex;
389
			int i;
390
			// Util.logger.log(Level.FINEST, "vertex starts");
391
			_content.startSolidVertexArray(solid);
392
			for (i = 0; i < vertices.size(); i++) {
393

  
394
				vertex = vertices.get(i);
395

  
396
				// Util.logger.log(Level.FINEST,"Vertice sin
397
				// transformar"+vertex.x()+";"+vertex.y()+";"+vertex.z()+";");
398
				vertex = matrix.prod(vertex, matrix);
399

  
400
				// Util.logger.log(Level.FINEST,"Vertice
401
				// transformado"+vertex.x()+";"+vertex.y()+";"+vertex.z()+";");
402
				_content.addVertexToSolid(solid, vertex.x(), vertex.y(), vertex
403
						.z());
404

  
405
			}
406
			_content.endSolidVertexArray();
407

  
408
			Vector<Vec3> normals = ((Geometry) drawable).getNormalArray();
409
			// Util.logger.log(Level.FINEST, "talla normals" + normals.size());
410

  
411
			if (normals == null)
412
				normals = new Vector<Vec3>();
413

  
414
			Vec3 normal;
415
			_content.startSolidNormalArray(solid);
416

  
417
			for (i = 0; i < normals.size(); i++) {
418

  
419
				normal = normals.get(i);
420
				// Util.logger.log(Level.FINEST, " normal bucleee" + normal);
421
				normal = matrix.prod(normal, matrix);
422
				normal.normalize();
423
				_content.addNormalToSolid(solid, normal.x(), normal.y(), normal
424
						.z());
425

  
426
			}
427
			_content.endSolidNormalArray();
428

  
429
			_content.setNormalBindingToSolid(solid, ((Geometry) drawable)
430
					.getNormalBinding());
431

  
432
			try {
433
				Vector<Vec4> colors = ((Geometry) drawable).getColorArray();
434
				if (colors == null)
435
					colors = new Vector<Vec4>();
436
				Vec4 color;
437
				// Util.logger.log(Level.FINEST, "color starts" +
438
				// colors.size());
439
				_content.startSolidColorArray(solid);
440
				for (i = 0; i < colors.size(); i++) {
441
					// Util.logger.log(Level.FINEST, "bucleeeeee 0");
442
					color = colors.get(i);
443
					_content.addColorToSolid(solid, (float) color.x(),
444
							(float) color.y(), (float) color.z(), (float) color
445
									.w());
446
					// Util.logger.log(Level.FINEST, "bucleeeeee");
447
				}
448

  
449
				_content.endSolidColorArray();
450

  
451
			} catch (NullPointerException e) {
452

  
453
			}
454

  
455
			// Util.logger.log(Level.FINEST, "primitiveSets: "
456
			// + ((Geometry) drawable).getNumPrimitiveSets());
457

  
458
			for (int k = 0; k < ((Geometry) drawable).getNumPrimitiveSets(); k++) {
459
				int mode = ((Geometry) drawable).getPrimitiveSet(k).getMode();
460
				int type = ((Geometry) drawable).getPrimitiveSet(k).getType();
461

  
462
				if (type == PrimitiveSet.Type.DrawArrayLengthsPrimitiveType) {
463

  
464
					int offset = 0;
465
					int accum = 0;
466
					DrawArrayLengths lengths = new DrawArrayLengths(
467
							((PrimitiveSet) ((Geometry) drawable)
468
									.getPrimitiveSet(k)).getCPtr());
469
					Vector<Integer> arrayLengths = lengths
470
							.getElementLengthsVector();
471

  
472
					if (arrayLengths == null)
473
						arrayLengths = new Vector<Integer>();
474

  
475
					for (int h = 0; h < arrayLengths.size(); h++) {
476

  
477
						Object primitiveSet = _content.startPrimitiveSet(mode,
478
								PrimitiveSet.Type.DrawArraysPrimitiveType);
479
						_content.addPrimitiveSetToSolid(solid, primitiveSet);
480

  
481
						accum = arrayLengths.get(h);
482

  
483
						for (int l = 0; l < accum; l++) {
484

  
485
							_content.addIndexToPrimitiveSet(primitiveSet,
486
									((Geometry) drawable).getPrimitiveSet(k)
487
											.index(offset + l));
488

  
489
						}
490

  
491
						offset = offset + accum;
492
						_content.endPrimitiveSetIndexArray();
493
						_content.endPrimitiveSet(primitiveSet);
494

  
495
					}
496

  
497
				} else {
498
					Object primitiveSet = _content
499
							.startPrimitiveSet(mode, type);
500

  
501
					_content.addPrimitiveSetToSolid(solid, primitiveSet);
502
					_content.startPrimitiveSetIndexArray(primitiveSet,
503
							((Geometry) drawable).getPrimitiveSet(k)
504
									.getNumIndices());
505
					// Util.logger.log(Level.FINEST, "Num Indices: "
506
					// + String.valueOf(((Geometry) drawable)
507
					// .getPrimitiveSet(k).getNumIndices()));
508
					for (int ps = 0; ps < ((Geometry) drawable)
509
							.getPrimitiveSet(k).getNumIndices(); ps++) {
510

  
511
						// Util.logger.log(Level.FINEST, "adding index");
512
						_content.addIndexToPrimitiveSet(primitiveSet,
513
								((Geometry) drawable).getPrimitiveSet(k).index(
514
										ps));
515
						// Util.logger.log(Level.FINEST, String.valueOf(t));
516
						// t++;
517
					}
518
					_content.endPrimitiveSetIndexArray();
519
					_content.endPrimitiveSet(primitiveSet);
520
				}
521

  
522
			}
523

  
524
			Vector<Integer> addedTextures = new Vector<Integer>();
525
			boolean addedMaterial = false;
526

  
527
			addedTextures = pushTexturesDrawable(drawable);
528

  
529
			// Util.logger.log(Level.FINEST, "Added textures: " +
530
			// addedTextures);
531

  
532
			try {
533
				addTexturesToGeometry(solid);
534
			} catch (Exception e) {
535

  
536
				e.printStackTrace();
537
			}
538

  
539
			// Util.logger.log(Level.FINEST, "getNumTextures"
540
			// + drawable.getOrCreateStateSet().getNumTextureStages());
541
			for (j = 0; j < drawable.getOrCreateStateSet()
542
					.getNumTextureStages(); j++) {
543

  
544
				try {
545
					if (drawable.getOrCreateStateSet().getTextureAttribute(j) != null) {
546
						Vector<Vec2> texCoords = ((Geometry) drawable)
547
								.getTexCoordArray(j);
548
						if (texCoords == null)
549
							texCoords = new Vector<Vec2>();
550
						Vec2 texCoord;
551

  
552
						_content.startSolidTexCoordArray(solid, texCoords
553
								.size(), j);
554

  
555
						for (i = 0; i < texCoords.size(); i++) {
556

  
557
							texCoord = texCoords.get(i);
558
							_content.addTextureCoordinateToSolid(solid,
559
									texCoord.x(), texCoord.y(), j);
560

  
561
						}
562
						_content.endSolidTexCoordArray();
563
					}
564
				} catch (TextureStageException e) {
565
					// TODO Auto-generated catch block
566
					e.printStackTrace();
567
				}
568
			}
569

  
570
			addedMaterial = pushMaterialDrawable(drawable);
571
			try {
572

  
573
				Material osgMaterial = _materials.lastElement();
574

  
575
				float x, y, z, w;
576

  
577
				Vec4 vectorAmb = new Vec4();
578
				Vec4 vectorDif = new Vec4();
579
				Vec4 vectorEmi = new Vec4();
580
				Vec4 vectorSpe = new Vec4();
581

  
582
				vectorAmb = osgMaterial.getAmbient(Material.Face.FRONT);
583
				vectorDif = osgMaterial.getDiffuse(Material.Face.FRONT);
584
				vectorEmi = osgMaterial.getEmission(Material.Face.FRONT);
585
				vectorSpe = osgMaterial.getSpecular(Material.Face.FRONT);
586

  
587
				Object material = _content.startMaterial();
588
				x = (float) vectorAmb.x();
589
				y = (float) vectorAmb.y();
590
				z = (float) vectorAmb.z();
591
				w = (float) vectorAmb.w();
592

  
593
				_content.addAmbientToMaterial(material, x, y, z, w);
594

  
595
				x = (float) vectorDif.x();
596
				y = (float) vectorDif.y();
597
				z = (float) vectorDif.z();
598
				w = (float) vectorDif.w();
599

  
600
				_content.addDiffuseToMaterial(material, x, y, z, w);
601

  
602
				x = (float) vectorSpe.x();
603
				y = (float) vectorSpe.y();
604
				z = (float) vectorSpe.z();
605
				w = (float) vectorSpe.w();
606

  
607
				_content.addSpecularToMaterial(material, x, y, z, w);
608

  
609
				x = (float) vectorEmi.x();
610
				y = (float) vectorEmi.y();
611
				z = (float) vectorEmi.z();
612
				w = (float) vectorEmi.w();
613

  
614
				_content.addEmissionToMaterial(material, x, y, z, w);
615

  
616
				_content.addShininessToMaterial(material, osgMaterial
617
						.getShininess(Material.Face.FRONT));
618

  
619
				_content.addMaterialToSolid(solid, material);
620

  
621
				_content.endMaterial(material);
622

  
623
			} catch (ArrayIndexOutOfBoundsException ex) {
624

  
625
			}
626

  
627
			if (_blendings.lastElement())
628
				_content.addBlendingToSolid(solid, true);
629
			else
630
				_content.addBlendingToSolid(solid, drawable
631
						.getOrCreateStateSet().getEnabledBlending());
632

  
633
			popTextures(addedTextures);
634

  
635
			_content.endSolid(solid);
636

  
637
		}
638
		// Util.logger.log(Level.FINEST, "drawable parsed");
639
	}
640

  
641
	protected boolean pushTransform(Group group) {
642

  
643
		if (group instanceof MatrixTransform) {
644

  
645
			// Util.logger.log(Level.FINEST,"Push a MatrixTransform");
646
			_transforms.push(((MatrixTransform) group).getMatrix());
647

  
648
			return true;
649

  
650
		}
651

  
652
		if (group instanceof PositionAttitudeTransform) {
653

  
654
			// Util.logger.log(Level.FINEST,"Push a PAT");
655
			Matrix scaleMatrix = Matrix
656
					.scale(((PositionAttitudeTransform) group).getScale());
657

  
658
			Quat quat = new Quat((((PositionAttitudeTransform) group)
659
					.getAttitudeAngle()), (((PositionAttitudeTransform) group)
660
					.getAttitudeAxis()));
661
			Matrix rotateMatrix = Matrix.rotate(quat);
662

  
663
			Matrix transMatrix = Matrix
664
					.translate(((PositionAttitudeTransform) group)
665
							.getPosition());
666

  
667
			// rotateMatrix.postMult(scaleMatrix);
668
			// transMatrix.postMult(rotateMatrix);
669
			rotateMatrix.preMult(scaleMatrix);
670
			transMatrix.preMult(rotateMatrix);
671

  
672
			_transforms.push(transMatrix);
673

  
674
			return true;
675

  
676
		}
677

  
678
		if (group instanceof AutoTransform) {
679

  
680
			// Util.logger.log(Level.FINEST,"Push a AutoTransform");
681
			Matrix scaleMatrix = Matrix.scale(((AutoTransform) group)
682
					.getScale());
683
			Quat quat = new Quat((((AutoTransform) group).getRotationAngle()),
684
					(((AutoTransform) group).getRotationAxis()));
685
			Matrix rotateMatrix = Matrix.rotate(quat);
686
			Matrix transMatrix = Matrix.translate(((AutoTransform) group)
687
					.getPosition());
688

  
689
			// rotateMatrix.postMult(scaleMatrix);
690
			// transMatrix.postMult(rotateMatrix);
691

  
692
			rotateMatrix.preMult(scaleMatrix);
693
			transMatrix.preMult(rotateMatrix);
694

  
695
			_transforms.push(transMatrix);
696

  
697
			return true;
698

  
699
		}
700

  
701
		return false;
702

  
703
	}
704

  
705
	protected Vector<Integer> pushTextures(Node node) throws NodeException {
706

  
707
		int numTextures;
708
		numTextures = node.getOrCreateStateSet().getNumTextureStages();
709
		Vector<Texture2D> vector = node.getOrCreateStateSet()
710
				.getTextureAttributeVector();
711
		Vector<Integer> stages = new Vector<Integer>();
712

  
713
		for (int i = 0; i < numTextures; i++) {
714

  
715
			_textures.get(i);
716

  
717
			_textures.add(i, new Stack<Texture2D>());
718

  
719
			_textures.get(i).push(vector.get(i));
720
			// Util.logger.log(Level.FINEST,"PUSH");
721
			stages.add(i);
722

  
723
		}
724

  
725
		return stages;
726
	}
727

  
728
	protected boolean pushMaterial(Node node) throws NodeException {
729

  
730
		boolean hasMaterial = false;
731

  
732
		Material material;
733
		material = node.getOrCreateStateSet().getMaterial();
734
		_materials.push(material);
735
		hasMaterial = true;
736

  
737
		return hasMaterial;
738

  
739
	}
740

  
741
	protected Vector<Integer> pushTexturesDrawable(Drawable drawable)
742
			throws NodeException {
743

  
744
		int numTextures;
745
		numTextures = drawable.getOrCreateStateSet().getNumTextureStages();
746
		Vector<Texture2D> vector = drawable.getOrCreateStateSet()
747
				.getTextureAttributeVector();
748
		Vector<Integer> stages = new Vector<Integer>();
749

  
750
		// Util.logger.log(Level.FINEST, "NumTextures: " + numTextures);
751
		for (int i = 0; i < numTextures; i++) {
752

  
753
			try {
754

  
755
				_textures.get(i);
756

  
757
			} catch (ArrayIndexOutOfBoundsException ex) {
758

  
759
				_textures.add(i, new Stack<Texture2D>());
760

  
761
			}
762

  
763
			try {
764

  
765
				_textures.get(i).push(vector.get(i));
766
				// Util.logger.log(Level.FINEST,"PUSH");
767
				stages.add(i);
768
				Util.logger.log(Level.FINEST, "Added textures: " + stages);
769
			} catch (ArrayIndexOutOfBoundsException ex) {
770

  
771
			}
772
		}
773

  
774
		return stages;
775
	}
776

  
777
	protected boolean pushMaterialDrawable(Drawable draw) throws NodeException {
778

  
779
		boolean hasMaterial = false;
780

  
781
		try {
782

  
783
			Material material;
784
			material = draw.getOrCreateStateSet().getMaterial();
785
			_materials.push(material);
786
			hasMaterial = true;
787

  
788
		} catch (ArrayIndexOutOfBoundsException ex) {
789

  
790
			hasMaterial = false;
791

  
792
		} catch (NullPointerException e) {
793

  
794
		}
795

  
796
		return hasMaterial;
797

  
798
	}
799

  
800
	protected void popTextures(Vector<Integer> stages) {
801

  
802
		for (int i = 0; i < stages.size(); i++) {
803

  
804
			// Util.logger.log(Level.FINEST,"POP");
805
			_textures.get(stages.get(i)).pop();
806

  
807
		}
808

  
809
	}
810

  
811
	protected void addTexturesToGeometry(Object solid) throws Exception {
812

  
813
		BufferedImage image;
814
		for (int i = 0; i < _textures.size(); i++) {
815

  
816
			try {
817
				// Util.logger.log(Level.FINEST, "Num textures in stack: "
818
				// + _textures.get(i).size());
819
				_textures.get(i).lastElement();
820
				try {
821
					// Util.logger.log(Level.FINEST, "TRYING STAGE: " + i);
822
					image = _textures.get(i).lastElement().getImage()
823
							.getBufferedImage();
824
					_content.addTextureToSolid(solid, i, image);
825

  
826
				} catch (ArrayIndexOutOfBoundsException ex) {
827

  
828
				}
829
			}
830

  
831
			catch (NoSuchElementException ex) {
832

  
833
			}
834
		}
835

  
836
	}
837

  
838
	@Override
839
	public String getFormat() {
840
		// TODO Auto-generated method stub
841
		return null;
842
	}
843

  
844
}
tags/3D_Animation_v1_0alpha_Build_5/libraries/libGPE-OSG/src/main/resources/dumptruck.osg
1
Group {
2
  UniqueID Group_0
3
  DataVariance STATIC
4
  cullingActive TRUE
5
  num_children 1
6
  Geode {
7
    DataVariance DYNAMIC
8
    name "dumptruck.osg"
9
    cullingActive TRUE
10
    num_drawables 3
11
    Geometry {
12
      DataVariance DYNAMIC
13
      StateSet {
14
        UniqueID StateSet_1
15
        DataVariance STATIC
16
        rendering_hint OPAQUE_BIN
17
        renderBinMode INHERIT
18
        GL_CULL_FACE OFF
19
        GL_LIGHTING ON
20
        Material {
21
          DataVariance STATIC
22
          ColorMode OFF
23
          ambientColor 0.2 0.2 0.2 1
24
          diffuseColor 0.8 0.8 0.8 1
25
          specularColor 0 0 0 1
26
          emissionColor 0 0 0 1
27
          shininess 0
28
        }
29
      }
30
      useDisplayList TRUE
31
      Primitives 1
32
      {
33
        DrawArrayLengths TRIANGLE_STRIP 0 907
34
        {
35
          3 3 3 3 3 3 3 3
36
          3 3 3 3 3 3 3 3
37
          3 3 3 3 3 3 3 3
38
          3 3 3 3 3 3 3 3
39
          3 3 3 3 3 3 3 3
40
          3 3 3 3 3 3 3 3
41
          3 3 3 3 3 3 3 3
42
          4 4 4 4 4 4 4 4
43
          4 4 4 4 4 4 4 4
44
          4 4 4 4 4 4 4 4
45
          4 4 4 4 4 4 4 4
46
          4 4 4 4 4 4 4 4
47
          4 4 4 4 4 4 4 4
48
          4 4 4 4 4 4 4 4
49
          4 4 4 4 4 4 4 4
50
          4 4 4 4 4 4 4 4
51
          4 4 4 4 4 4 4 4
52
          4 4 4 4 4 4 4 4
53
          4 4 4 4 4 4 4 4
54
          4 4 4 4 4 4 4 4
55
          4 4 4 4 4 4 4 4
56
          4 4 4 4 4 4 4 4
57
          4 4 4 4 4 4 4 4
58
          4 4 4 4 4 4 4 4
59
          4 4 4 4 4 4 4 4
60
          4 4 4 4 4 4 4 4
61
          4 4 4 4 4 4 4 4
62
          4 4 4 4 4 4 4 4
63
          4 4 4 4 4 4 4 4
64
          4 4 4 4 4 4 4 4
65
          4 4 4 4 4 4 4 4
66
          4 4 4 4 4 4 4 4
67
          4 4 4 4 4 4 4 4
68
          4 4 4 4 4 4 4 4
69
          4 4 4 4 4 4 4 4
70
          4 4 4 4 4 4 4 4
71
          4 4 4 4 4 4 4 4
72
          4 4 4 4 4 4 4 4
73
          4 4 4 4 4 4 4 4
74
          4 4 4 4 4 4 4 4
75
          4 4 4 4 4 4 4 4
76
          4 4 4 4 4 4 4 4
77
          4 4 4 4 4 4 4 4
78
          4 4 4 4 4 4 4 4
79
          4 4 4 4 4 4 4 4
80
          4 4 4 4 4 4 4 4
81
          4 4 4 4 4 4 4 4
82
          4 4 4 4 4 4 62 62
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff