Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db6f11bd authored by Alex Sakhartchouk's avatar Alex Sakhartchouk
Browse files

Fixing a3d files to reflect the new element structure.

Change-Id: I44d95c9411706813dde815c5f052f3615e8b483e
parent 70d4e502
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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);
    }
+2 −3
Original line number Diff line number Diff line
@@ -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);
    }
+4 −0
Original line number Diff line number Diff line
@@ -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);
+6 −2
Original line number Diff line number Diff line
@@ -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);

Loading