diff options
| author | Alex Sakhartchouk <alexst@google.com> | 2010-09-07 12:10:18 -0700 |
|---|---|---|
| committer | Alex Sakhartchouk <alexst@google.com> | 2010-09-07 12:10:18 -0700 |
| commit | db6f11bd30ad8afc94fdaffd81c9588289a3f6e5 (patch) | |
| tree | a84123422ba3d76291ca747ee94dad5d7fdec82d | |
| parent | 70d4e5024298f71edb3b04867e05568f5495b4ce (diff) | |
| download | frameworks_base-db6f11bd30ad8afc94fdaffd81c9588289a3f6e5.zip frameworks_base-db6f11bd30ad8afc94fdaffd81c9588289a3f6e5.tar.gz frameworks_base-db6f11bd30ad8afc94fdaffd81c9588289a3f6e5.tar.bz2 | |
Fixing a3d files to reflect the new element structure.
Change-Id: I44d95c9411706813dde815c5f052f3615e8b483e
| -rw-r--r-- | libs/rs/java/ModelViewer/res/raw/robot.a3d | bin | 144500 -> 144528 bytes | |||
| -rw-r--r-- | libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java | 9 | ||||
| -rw-r--r-- | libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java | 5 | ||||
| -rw-r--r-- | libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs | 4 | ||||
| -rw-r--r-- | libs/rs/java/ModelViewer/src/com/android/modelviewer/simplemodel.rs | 8 | ||||
| -rw-r--r-- | libs/rs/java/Samples/res/raw/torus.a3d | bin | 571236 -> 571248 bytes |
6 files changed, 16 insertions, 10 deletions
diff --git a/libs/rs/java/ModelViewer/res/raw/robot.a3d b/libs/rs/java/ModelViewer/res/raw/robot.a3d Binary files differindex 2d7d32b..f48895c 100644 --- a/libs/rs/java/ModelViewer/res/raw/robot.a3d +++ b/libs/rs/java/ModelViewer/res/raw/robot.a3d diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java index 9672a6a..85c1d42 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java @@ -105,7 +105,7 @@ public class SceneGraphRS { bs.setMin(Sampler.Value.LINEAR); bs.setMag(Sampler.Value.LINEAR); bs.setWrapS(Sampler.Value.CLAMP); - bs.setWrapT(Sampler.Value.WRAP); + bs.setWrapT(Sampler.Value.CLAMP); mSampler = bs.create(); ProgramFragment.Builder b = new ProgramFragment.Builder(mRS); @@ -123,7 +123,6 @@ public class SceneGraphRS { mPVA = new ProgramVertex.MatrixAllocation(mRS); mPVBackground.bindAllocation(mPVA); - mPVA.setupProjectionNormalized(mWidth, mHeight); mScript.set_gPVBackground(mPVBackground); } @@ -159,14 +158,14 @@ public class SceneGraphRS { mGroup1.addChild(mRobot1); mGroup1.addChild(mRobot2); - mGroup1.setTransform(0, new Float4(0.0f, 0.0f, 5.0f, 0.0f), TransformType.TRANSLATE); + mGroup1.setTransform(0, new Float4(0.0f, 0.0f, -15.0f, 0.0f), TransformType.TRANSLATE); mGroup1.setTransform(1, new Float4(0.0f, 1.0f, 0.0f, 15.0f), TransformType.ROTATE); - mRobot1.setTransform(0, new Float4(-2.0f, -0.5f, 0.0f, 0.0f), TransformType.TRANSLATE); + mRobot1.setTransform(0, new Float4(-3.0f, -0.5f, 0.0f, 0.0f), TransformType.TRANSLATE); mRobot1.setTransform(1, new Float4(0.0f, 1.0f, 0.0f, 20.0f), TransformType.ROTATE); mRobot1.setTransform(2, new Float4(0.2f, 0.2f, 0.2f, 0.0f), TransformType.SCALE); - mRobot2.setTransform(0, new Float4(2.0f, 0.0f, 0.0f, 0.0f), TransformType.TRANSLATE); + mRobot2.setTransform(0, new Float4(3.0f, 0.0f, 0.0f, 0.0f), TransformType.TRANSLATE); mRobot2.setTransform(1, new Float4(0.0f, 1.0f, 0.0f, -20.0f), TransformType.ROTATE); mRobot2.setTransform(2, new Float4(0.3f, 0.3f, 0.3f, 0.0f), TransformType.SCALE); } diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java index b8b0119..d8d1a6e 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java @@ -79,7 +79,7 @@ public class SimpleModelRS { mRotation += 360; } - mScript.set_gRotate(-(float)mRotation); + mScript.set_gRotate((float)mRotation); mLastX = x; mLastY = y; @@ -101,7 +101,7 @@ public class SimpleModelRS { bs.setMin(Sampler.Value.LINEAR); bs.setMag(Sampler.Value.LINEAR); bs.setWrapS(Sampler.Value.CLAMP); - bs.setWrapT(Sampler.Value.WRAP); + bs.setWrapT(Sampler.Value.CLAMP); mSampler = bs.create(); ProgramFragment.Builder b = new ProgramFragment.Builder(mRS); @@ -119,7 +119,6 @@ public class SimpleModelRS { mPVA = new ProgramVertex.MatrixAllocation(mRS); mPVBackground.bindAllocation(mPVA); - mPVA.setupProjectionNormalized(mWidth, mHeight); mScript.set_gPVBackground(mPVBackground); } diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs b/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs index c794438..ce6bb1e 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs @@ -71,6 +71,10 @@ int root(int launchID) { rsgClearDepth(1.0f); rsgBindProgramVertex(gPVBackground); + rs_matrix4x4 proj; + float aspect = (float)rsgGetWidth() / (float)rsgGetHeight(); + rsMatrixLoadPerspective(&proj, 30.0f, aspect, 0.1f, 100.0f); + rsgProgramVertexLoadProjectionMatrix(&proj); rsgBindProgramFragment(gPFBackground); rsgBindProgramStore(gPFSBackground); diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/simplemodel.rs b/libs/rs/java/ModelViewer/src/com/android/modelviewer/simplemodel.rs index adb609c..43be266 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/simplemodel.rs +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/simplemodel.rs @@ -46,6 +46,10 @@ int root(int launchID) { rsgClearDepth(1.0f); rsgBindProgramVertex(gPVBackground); + rs_matrix4x4 proj; + float aspect = (float)rsgGetWidth() / (float)rsgGetHeight(); + rsMatrixLoadPerspective(&proj, 30.0f, aspect, 0.1f, 100.0f); + rsgProgramVertexLoadProjectionMatrix(&proj); rsgBindProgramFragment(gPFBackground); rsgBindProgramStore(gPFSBackground); @@ -54,9 +58,9 @@ int root(int launchID) { rs_matrix4x4 matrix; rsMatrixLoadIdentity(&matrix); // Position our model on the screen - rsMatrixTranslate(&matrix, 0.0f, -0.3f, 1.2f); + rsMatrixTranslate(&matrix, 0.0f, -0.3f, -10.0f); rsMatrixScale(&matrix, 0.2f, 0.2f, 0.2f); - rsMatrixRotate(&matrix, -25.0f, 1.0f, 0.0f, 0.0f); + rsMatrixRotate(&matrix, 25.0f, 1.0f, 0.0f, 0.0f); rsMatrixRotate(&matrix, gRotate, 0.0f, 1.0f, 0.0f); rsgProgramVertexLoadModelMatrix(&matrix); diff --git a/libs/rs/java/Samples/res/raw/torus.a3d b/libs/rs/java/Samples/res/raw/torus.a3d Binary files differindex d09bc13..0322b01 100644 --- a/libs/rs/java/Samples/res/raw/torus.a3d +++ b/libs/rs/java/Samples/res/raw/torus.a3d |
