Author: paperwing
Date: 2011-05-18 10:34:53 -0700 (Wed, 18 May 2011)
New Revision: 25465
Added:
csplugins/trunk/toronto/paperwing/TestJME3/.classpath
csplugins/trunk/toronto/paperwing/TestJME3/.project
csplugins/trunk/toronto/paperwing/TestJME3/.settings/
csplugins/trunk/toronto/paperwing/TestJME3/.settings/org.eclipse.jdt.core.prefs
csplugins/trunk/toronto/paperwing/TestJME3/liblwjgl.jnilib
csplugins/trunk/toronto/paperwing/TestJME3/src/
csplugins/trunk/toronto/paperwing/TestJME3/src/TestJME3/
csplugins/trunk/toronto/paperwing/TestJME3/src/TestJME3/TestJME3.java
Log:
OpenGL test for the jMonkeyEngine lbrary
Added: csplugins/trunk/toronto/paperwing/TestJME3/.classpath
===================================================================
--- csplugins/trunk/toronto/paperwing/TestJME3/.classpath
(rev 0)
+++ csplugins/trunk/toronto/paperwing/TestJME3/.classpath 2011-05-18
17:34:53 UTC (rev 25465)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="lib" path="/Users/yuedong/Downloads/OpenGL
graphics libraries/jME3_2011-05-12/jMonkeyEngine3.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: csplugins/trunk/toronto/paperwing/TestJME3/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: csplugins/trunk/toronto/paperwing/TestJME3/.project
===================================================================
--- csplugins/trunk/toronto/paperwing/TestJME3/.project
(rev 0)
+++ csplugins/trunk/toronto/paperwing/TestJME3/.project 2011-05-18 17:34:53 UTC
(rev 25465)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>TestJME3</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: csplugins/trunk/toronto/paperwing/TestJME3/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
csplugins/trunk/toronto/paperwing/TestJME3/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
csplugins/trunk/toronto/paperwing/TestJME3/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
csplugins/trunk/toronto/paperwing/TestJME3/.settings/org.eclipse.jdt.core.prefs
2011-05-18 17:34:53 UTC (rev 25465)
@@ -0,0 +1,12 @@
+#Thu May 12 13:35:44 EDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Property changes on:
csplugins/trunk/toronto/paperwing/TestJME3/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: csplugins/trunk/toronto/paperwing/TestJME3/liblwjgl.jnilib
===================================================================
(Binary files differ)
Property changes on: csplugins/trunk/toronto/paperwing/TestJME3/liblwjgl.jnilib
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: csplugins/trunk/toronto/paperwing/TestJME3/src/TestJME3/TestJME3.java
===================================================================
--- csplugins/trunk/toronto/paperwing/TestJME3/src/TestJME3/TestJME3.java
(rev 0)
+++ csplugins/trunk/toronto/paperwing/TestJME3/src/TestJME3/TestJME3.java
2011-05-18 17:34:53 UTC (rev 25465)
@@ -0,0 +1,129 @@
+package TestJME3;
+
+import java.util.Random;
+
+// import TestGraphics.DrawnNode;
+
+import com.jme3.app.SimpleApplication;
+import com.jme3.light.DirectionalLight;
+import com.jme3.light.PointLight;
+import com.jme3.material.Material;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.FastMath;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector3f;
+import com.jme3.scene.Geometry;
+import com.jme3.scene.shape.Sphere;
+import com.jme3.util.TangentBinormalGenerator;
+
+/**
+ * Sample 2 - How to use nodes as handles to manipulate objects in the scene
+ * graph. You can rotate, translate, and scale objects by manipulating their
+ * parent nodes. The Root Node is special: Only what is attached to the Root
+ * Node appears in the scene.
+ */
+public class TestJME3 extends SimpleApplication {
+
+ private final int NODE_COUNT = 5500;
+ private final float LARGE_SPHERE_RADIUS = 3.0f;
+
+ float angle;
+ PointLight pl;
+ Geometry lightMdl;
+
+ public static void main(String[] args){
+ TestJME3 app = new TestJME3();
+ app.start();
+ }
+
+ @Override
+ public void simpleInitApp() {
+ // Geometry teapot = (Geometry)
assetManager.loadModel("Models/Teapot/Teapot.obj");
+ // TangentBinormalGenerator.generate(teapot.getMesh(), true);
+
+ // teapot.setLocalScale(2f);
+
+ Sphere s = new Sphere(3, 2, 2);
+ Geometry sphere = new Geometry ("Sphere", s);
+ Material mat = new Material(assetManager,
"Common/MatDefs/Light/Lighting.j3md");
+
+ // mat.selectTechnique("GBuf");
+
+ mat.setFloat("Shininess", 12);
+ mat.setBoolean("UseMaterialColors", true);
+
+// mat.setTexture("ColorRamp",
assetManager.loadTexture("Textures/ColorRamp/cloudy.png"));
+//
+// mat.setBoolean("VTangent", true);
+// mat.setBoolean("Minnaert", true);
+// mat.setBoolean("WardIso", true);
+// mat.setBoolean("VertexLighting", true);
+// mat.setBoolean("LowQuality", true);
+// mat.setBoolean("HighQuality", true);
+
+ mat.setColor("Ambient", ColorRGBA.Black);
+ mat.setColor("Diffuse", ColorRGBA.Gray);
+ mat.setColor("Specular", ColorRGBA.Gray);
+
+ sphere.setMaterial(mat);
+
+ DirectionalLight dl = new DirectionalLight();
+ dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
+ dl.setColor(ColorRGBA.Cyan);
+ rootNode.addLight(dl);
+
+ generateNodes();
+ }
+
+ private void generateNodes() {
+ Random random = new Random();
+ //random.setSeed(nodeSeed);
+ // nodeSeed++;
+ // 500 should be the default seed
+
+ Sphere sphere = new Sphere(10, 10, 0.03f);;
+ Geometry geometry;
+ Material material = new Material(assetManager,
"Common/MatDefs/Light/Lighting.j3md");
+
+ material.setFloat("Shininess", 12);
+ material.setBoolean("UseMaterialColors", true);
+
+ material.setColor("Ambient", ColorRGBA.Black);
+ material.setColor("Diffuse", ColorRGBA.Gray);
+ material.setColor("Specular", ColorRGBA.Gray);
+
+ material.setBoolean("LowQuality", true);
+
+ float x, y, z;
+ float radius = LARGE_SPHERE_RADIUS;
+
+ for (int i = 0; i < NODE_COUNT; i++) {
+ do {
+ x = (float)(radius * 2 * random.nextFloat() -
radius);
+ y = (float)(radius * 2 * random.nextFloat() -
radius);
+ z = (float)(radius * 2 * random.nextFloat() -
radius);
+ } while (Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z,
2) > Math.pow(radius, 2));
+
+ geometry = new Geometry("Sphere", sphere);
+ geometry.setMaterial(material);
+
+ geometry.move(x, y, z);
+
+ rootNode.attachChild(geometry);
+ }
+
+ //System.out.println("Last node float: " + random.nextFloat());
+ }
+
+ @Override
+ public void simpleUpdate(float tpf){
+// cam.setLocation(new Vector3f(2.0632997f, 1.9493936f, 2.6885238f));
+// cam.setRotation(new Quaternion(-0.053555284f, 0.9407851f,
-0.17754152f, -0.28378546f));
+
+ // angle += tpf;
+ // angle %= FastMath.TWO_PI;
+
+ // pl.setPosition(new Vector3f(FastMath.cos(angle) * 2f, 0.5f,
FastMath.sin(angle) * 2f));
+ // lightMdl.setLocalTranslation(pl.getPosition());
+ }
+}
\ No newline at end of file
Property changes on:
csplugins/trunk/toronto/paperwing/TestJME3/src/TestJME3/TestJME3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.