Package com.jme3.scene

Examples of com.jme3.scene.Spatial.scale()


        cachedWorldMat.setTranslation(worldTransform.getTranslation());

        TempVars vars = TempVars.get();
        Matrix4f scaleMat = vars.tempMat4;
        scaleMat.loadIdentity();
        scaleMat.scale(worldTransform.getScale());
        cachedWorldMat.multLocal(scaleMat);
        vars.release();
    }

    /**
 
View Full Code Here


        cachedLocalMat.setTranslation(g.localTransform.getTranslation());

        TempVars vars = TempVars.get();
        Matrix4f scaleMat = vars.tempMat4;
        scaleMat.loadIdentity();
        scaleMat.scale(g.localTransform.getScale());
        cachedLocalMat.multLocal(scaleMat);
        vars.release();
        return cachedLocalMat;
    }
   
View Full Code Here

  @Override
  public void simpleInitApp() {

    // create the geometry and attach it
    Geometry teaGeom = (Geometry) assetManager.loadModel("Models/Teapot/Teapot.obj");
    teaGeom.scale(3);

    DirectionalLight dl = new DirectionalLight();
    dl.setColor(ColorRGBA.White);
    dl.setDirection(Vector3f.UNIT_XYZ.negate());
View Full Code Here

        for (int i = 0; i < nB.limit(); i += 3) {
            dir.set(nB.get(i), nB.get(i + 1), nB.get(i + 2));
            a = new Arrow(dir);
            a.setLineWidth(3f);
            g = new Geometry("Normal" + dir, a);
            g.scale(.1f);
            g.setLocalTranslation(vB.get(i), vB.get(i + 1), vB.get(i + 2));
            g.setMaterial(DebugMaterials.normalMat);
            normals.attachChild(g);
        }
View Full Code Here

        for (int i = 0; i < tB.limit(); i += 4) {
            dir.set(tB.get(i), tB.get(i + 1), tB.get(i + 2)).normalizeLocal();
            a = new Arrow(dir);
            a.setLineWidth(2f);
            g = new Geometry("Tangent" + dir, a);
            g.scale(.1f);
            g.setLocalTranslation(vB.get(i - posFix), vB.get((i - posFix) + 1),
                                  vB.get((i - posFix) + 2));
            g.setMaterial(DebugMaterials.tangentMat);
            tangents.attachChild(g);
            posFix++;
View Full Code Here

        for (int i = 0; i < bnB.limit(); i += 3) {
            dir.set(bnB.get(i), bnB.get(i + 1), bnB.get(i + 2));
            a = new Arrow(dir);
            g = new Geometry("Binormal" + dir, a);
            g.scale(.1f);
            g.setLocalTranslation(vB.get(i), vB.get(i + 1), vB.get(i + 2));
            g.setMaterial(DebugMaterials.binormalMat);
            binormals.attachChild(g);
        }
View Full Code Here

        invWavelength4.z = 1.0f / FastMath.pow(wavelength.z, 4.0f);
    }
   
    private void createGround(String groundTexture) {
        Spatial geom = createSphere();
        geom.scale(getInnerRadius());
        mPlanetGround = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mPlanetGround.setTexture("DiffuseMap", assetManager.loadTexture(groundTexture));
        mPlanetGround.setTexture("GlowMap", assetManager.loadTexture("Textures/Planets/Earth/Earthlights2_1280.jpg"));
        mPlanetGround.setFloat("Shininess", 0.01f); // [1,128]
        geom.setMaterial(mPlanetGround);
View Full Code Here

        ground = geom;
    }
   
    private void createClouds(String cloudTexture) {
        Spatial geom = createSphere();
        geom.scale(getCloudRadius());
        Material mClouds = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
        mClouds.setTexture("DiffuseMap", assetManager.loadTexture(cloudTexture));
        mClouds.setFloat("Shininess", 0.01f); // [1,128]
        mClouds.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);
        geom.setMaterial(mClouds);
View Full Code Here

        atmosphere.setMaterial(mAtmosphere);
    }
   
    private Spatial createSphere() {
      Spatial sphere = assetManager.loadModel(MESH_SPHERE);
      sphere.scale(0.25f);
        return sphere;
    }
   
    public void update(float tpf, Vector3f cameraLocation, Vector3f sunLocation) {
             
View Full Code Here

     */
    private void setupScene() {

        /** Load a Ninja model (OgreXML + material + texture from test_data) */
        Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
        ninja.scale(0.05f, 0.05f, 0.05f);
        ninja.rotate(0.0f, -3.0f, 0.0f);
        ninja.setLocalTranslation(0.0f, -5.0f, -2.0f);
        rootNode.attachChild(ninja);
        /** You must add a light to make the model visible */
        DirectionalLight sun = new DirectionalLight();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.