当前位置: 首页>>代码示例>>Java>>正文


Java Quad.scaleTextureCoordinates方法代码示例

本文整理汇总了Java中com.jme3.scene.shape.Quad.scaleTextureCoordinates方法的典型用法代码示例。如果您正苦于以下问题:Java Quad.scaleTextureCoordinates方法的具体用法?Java Quad.scaleTextureCoordinates怎么用?Java Quad.scaleTextureCoordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.scene.shape.Quad的用法示例。


在下文中一共展示了Quad.scaleTextureCoordinates方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TexturePreview

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public TexturePreview(ProjectAssetManager assetManager) {
    this.assetManager = assetManager;

    Quad quadMesh = new Quad(4.5f, 4.5f);
    Quad quadMesh3D = new Quad(4.5f, 4.5f);
    quadMesh3D.scaleTextureCoordinates(new Vector2f(4, 4));
    quad = new Geometry("previewQuad", quadMesh);
    quad.setLocalTranslation(new Vector3f(-2.25f, -2.25f, 0));
    quad3D = new Geometry("previewQuad", quadMesh3D);
    quad3D.setLocalTranslation(new Vector3f(-2.25f, -2.25f, 0));
    material3D = new Material(assetManager, "com/jme3/gde/core/properties/preview/tex3DThumb.j3md");
    material3D.setFloat("InvDepth", 1f / 16f);
    material3D.setInt("Rows", 4);
    material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    SceneApplication.getApplication().addSceneListener(this);
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:17,代码来源:TexturePreview.java

示例2: setupFloor

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void setupFloor() {
    Quad q = new Quad(20, 20);
   q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(10));
   Geometry geom = new Geometry("floor", q);
   Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
   mat.setColor("Diffuse", ColorRGBA.White);
   mat.setColor("Specular", ColorRGBA.White);
   mat.setColor("Ambient", ColorRGBA.Black);
   mat.setBoolean("UseMaterialColors", true);
   mat.setFloat("Shininess", 0);
   geom.setMaterial(mat);

   geom.rotate(-FastMath.HALF_PI, 0, 0);
   geom.center();
   geom.setShadowMode(RenderQueue.ShadowMode.Receive);
   rootNode.attachChild(geom);
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:18,代码来源:TestJaimeJ3o.java

示例3: setupFloor

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void setupFloor() {
	Quad q = new Quad(20, 20);
	q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(10));
	Geometry geom = new Geometry("floor", q);
	Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
	mat.setColor("Diffuse", ColorRGBA.White);
	mat.setColor("Specular", ColorRGBA.White);
	mat.setColor("Ambient", ColorRGBA.Black);
	mat.setBoolean("UseMaterialColors", true);
	mat.setFloat("Shininess", 0);
	geom.setMaterial(mat);

	geom.rotate(-FastMath.HALF_PI, 0, 0);
	geom.center();
	geom.setShadowMode(RenderQueue.ShadowMode.Receive);
	rootNode.attachChild(geom);
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:18,代码来源:TestXbufWithMaterialHook.java

示例4: DDSPreview

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public DDSPreview(ProjectAssetManager assetManager) {
    this.assetManager = assetManager;

    Quad quadMesh = new Quad(4.5f, 4.5f);
    Quad quadMesh3D = new Quad(4.5f, 4.5f);
    quadMesh3D.scaleTextureCoordinates(new Vector2f(4, 4));
    quad = new Geometry("previewQuad", quadMesh);
    quad.setLocalTranslation(new Vector3f(-2.25f, -2.25f, 0));
    quad3D = new Geometry("previewQuad", quadMesh3D);
    quad3D.setLocalTranslation(new Vector3f(-2.25f, -2.25f, 0));
    material3D = new Material(assetManager, "com/jme3/gde/core/properties/preview/tex3DThumb.j3md");
    material3D.setFloat("InvDepth", 1f / 16f);
    material3D.setInt("Rows", 4);
    material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    SceneApplication.getApplication().addSceneListener(this);
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:17,代码来源:DDSPreview.java

示例5: createSurface

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
/**
 * Create the surface quad
 * @return 
 */
protected Spatial createSurface() {
    Quad quad = new Quad(MAP_SIZE * TILE_SIZE, MAP_SIZE * TILE_SIZE);
    Geometry geometry = new Geometry(BLANK, quad);
    quad.scaleTextureCoordinates(new Vector2f(MAP_SIZE, MAP_SIZE));
    Material material = baseApplication.getModelManager().getMaterial("Materials/tile-floor.j3m");
    geometry.setMaterial(material);
    geometry.rotate(FastMath.DEG_TO_RAD * 90, 0, 0);
    return geometry;
}
 
开发者ID:jMonkeyEngine,项目名称:examplegame-skulls,代码行数:14,代码来源:Game.java

示例6: usewater

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
/**
     * @todo consume too much fps :'(
     * @todo move this to hexGrid or builder / should not be there.
     */
    private void usewater() {
        bufferFXNode.attachChild(SkyFactory.createSky(
                app.getAssetManager(), "org/hexgridapi/assets/Textures/BrightSky.dds", false));

        // we create a water processor
        SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(app.getAssetManager());
//        waterProcessor.setReflectionScene(spatial.getParent());
        waterProcessor.setReflectionScene(collisionNode.getParent().getParent());//rootNode

        // we set the water plane
        Vector3f waterLocation = new Vector3f(0, 0, 0);
        waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));
        app.getViewPort().addProcessor(waterProcessor);

        // we set wave properties
        waterProcessor.setWaterDepth(-4);         // transparency of water
        waterProcessor.setDistortionScale(0.05f); // strength of waves
        waterProcessor.setWaveSpeed(0.01f);       // speed of waves
        waterProcessor.setWaterTransparency(0.2f);
        waterProcessor.setRenderSize(256, 256);

        // we define the wave size by setting the size of the texture coordinates
        Quad quad = new Quad(200, 200);
        quad.scaleTextureCoordinates(new Vector2f(6f, 6f));

        // we create the water geometry from the quad
        Geometry water = new Geometry("water", quad);
        water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
        water.setLocalTranslation(-100, 0.01f, 125);
//        water.setShadowMode(RenderQueue.ShadowMode.Receive);
        water.setMaterial(waterProcessor.getMaterial());
        bufferFXNode.attachChild(water);
        ((Node) spatial).attachChild(bufferFXNode);
//        collisionNode.getParent().attachChild(bufferFXNode);
    }
 
开发者ID:MultiverseKing,项目名称:HexGrid_JME,代码行数:40,代码来源:BufferedChunk_old.java

示例7: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    viewPort.setBackgroundColor(ColorRGBA.DarkGray);
    flyCam.setEnabled(false);


    Quad q = new Quad(10, 10);

    Geometry geom = new Geometry("Quad", q);
    Material material = new Material(assetManager, "jme3test/texture/tex3DThumb.j3md");
    TextureKey key = new TextureKey("Textures/3D/flame.dds");
    key.setGenerateMips(true);
    key.setAsTexture3D(true);

    Texture t = assetManager.loadTexture(key);

    int rows = 4;//4 * 4

    q.scaleTextureCoordinates(new Vector2f(rows, rows));

    //The image only have 8 pictures and we have 16 thumbs, the data will be interpolated by the GPU
    material.setFloat("InvDepth", 1f / 16f);
    material.setInt("Rows", rows);
    material.setTexture("Texture", t);
    geom.setMaterial(material);

    rootNode.attachChild(geom);

    cam.setLocation(new Vector3f(4.7444625f, 5.160054f, 13.1939f));
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:31,代码来源:TestTexture3DLoading.java

示例8: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void simpleInitApp() {
        renderManager.setAlphaToCoverage(true);
        cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f));
        cam.setRotation(new Quaternion(-0.0044764364f, 0.9767943f, 0.21314798f, 0.020512417f));

//        cam.setLocation(new Vector3f(2.0606942f, 3.20342f, 6.7860126f));
//        cam.setRotation(new Quaternion(-0.017481906f, 0.98241085f, -0.12393151f, -0.13857932f));

        viewPort.setBackgroundColor(ColorRGBA.DarkGray);

        Quad q = new Quad(20, 20);
        q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(5));
        Geometry geom = new Geometry("floor", q);
        Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
        geom.setMaterial(mat);
        
        geom.rotate(-FastMath.HALF_PI, 0, 0);
        geom.center();
        geom.setShadowMode(ShadowMode.Receive);
        rootNode.attachChild(geom);

        // create the geometry and attach it
        Spatial teaGeom = assetManager.loadModel("Models/Tree/Tree2.mesh.xml");
        teaGeom.setQueueBucket(Bucket.Transparent);
        teaGeom.setShadowMode(ShadowMode.Cast);
        makeToonish(teaGeom);

        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White.mult(2));
        rootNode.addLight(al);

        DirectionalLight dl1 = new DirectionalLight();
        dl1.setDirection(new Vector3f(1, -1, 1).normalizeLocal());
        dl1.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl1);

        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
        dl.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl);

        rootNode.attachChild(teaGeom);

        FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
        CartoonEdgeFilter toon=new CartoonEdgeFilter();
        toon.setEdgeWidth(0.5f);
        toon.setEdgeIntensity(1.0f);
        toon.setNormalThreshold(0.8f);
        fpp.addFilter(toon);
        viewPort.addProcessor(fpp);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:52,代码来源:TestTransparentCartoonEdge.java

示例9: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void simpleInitApp() {
        renderManager.setAlphaToCoverage(true);
        cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f));
        cam.setRotation(new Quaternion(-0.0044764364f, 0.9767943f, 0.21314798f, 0.020512417f));

//        cam.setLocation(new Vector3f(2.0606942f, 3.20342f, 6.7860126f));
//        cam.setRotation(new Quaternion(-0.017481906f, 0.98241085f, -0.12393151f, -0.13857932f));

        viewPort.setBackgroundColor(ColorRGBA.DarkGray);

        Quad q = new Quad(20, 20);
        q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(5));
        Geometry geom = new Geometry("floor", q);
        Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
        geom.setMaterial(mat);

        geom.rotate(-FastMath.HALF_PI, 0, 0);
        geom.center();
        geom.setShadowMode(ShadowMode.Receive);
        rootNode.attachChild(geom);

        // create the geometry and attach it
        Spatial teaGeom = assetManager.loadModel("Models/Tree/Tree2.mesh.xml");
        teaGeom.setQueueBucket(Bucket.Transparent);
        teaGeom.setShadowMode(ShadowMode.Cast);

        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White.mult(2));
        rootNode.addLight(al);

        DirectionalLight dl1 = new DirectionalLight();
        dl1.setDirection(new Vector3f(1, -1, 1).normalizeLocal());
        dl1.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl1);

        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
        dl.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl);

        rootNode.attachChild(teaGeom);

        FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

        SSAOFilter ssao = new SSAOFilter(0.49997783f, 42.598858f, 35.999966f, 0.39299846f);
        fpp.addFilter(ssao);

        SSAOUI ui = new SSAOUI(inputManager, ssao);

        viewPort.addProcessor(fpp);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:52,代码来源:TestTransparentSSAO.java

示例10: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void simpleInitApp() {
        this.flyCam.setMoveSpeed(10);
        Node mainScene=new Node();
        cam.setLocation(new Vector3f(-27.0f, 1.0f, 75.0f));
        cam.setRotation(new Quaternion(0.03f, 0.9f, 0f, 0.4f));

        // load sky
        mainScene.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", false));

        
        File file = new File("wildhouse.zip");
        if (file.exists()) {
            useHttp = false;
        }
        // create the geometry and attach it
        // load the level from zip or http zip
        if (useHttp) {
            assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/wildhouse.zip", HttpZipLocator.class.getName());
        } else {
            assetManager.registerLocator("wildhouse.zip", ZipLocator.class.getName());
        }
        Spatial scene = assetManager.loadModel("main.scene");

        DirectionalLight sun = new DirectionalLight();
        Vector3f lightDir=new Vector3f(-0.37352666f, -0.50444174f, -0.7784704f);
        sun.setDirection(lightDir);
        sun.setColor(ColorRGBA.White.clone().multLocal(2));
        scene.addLight(sun);

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
           //add lightPos Geometry
        Sphere lite=new Sphere(8, 8, 3.0f);
        Geometry lightSphere=new Geometry("lightsphere", lite);
        lightSphere.setMaterial(mat);
        Vector3f lightPos=lightDir.multLocal(-400);
        lightSphere.setLocalTranslation(lightPos);
        rootNode.attachChild(lightSphere);


        SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(assetManager);
        waterProcessor.setReflectionScene(mainScene);
        waterProcessor.setDebug(false);
        waterProcessor.setLightPosition(lightPos);
        waterProcessor.setRefractionClippingOffset(1.0f);


        //setting the water plane
        Vector3f waterLocation=new Vector3f(0,-20,0);
        waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));
        WaterUI waterUi=new WaterUI(inputManager, waterProcessor);
        waterProcessor.setWaterColor(ColorRGBA.Brown);
        waterProcessor.setDebug(true);
        //lower render size for higher performance
//        waterProcessor.setRenderSize(128,128);
        //raise depth to see through water
//        waterProcessor.setWaterDepth(20);
        //lower the distortion scale if the waves appear too strong
//        waterProcessor.setDistortionScale(0.1f);
        //lower the speed of the waves if they are too fast
//        waterProcessor.setWaveSpeed(0.01f);

        Quad quad = new Quad(400,400);

        //the texture coordinates define the general size of the waves
        quad.scaleTextureCoordinates(new Vector2f(6f,6f));

        Geometry water=new Geometry("water", quad);
        water.setShadowMode(ShadowMode.Receive);
        water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
        water.setMaterial(waterProcessor.getMaterial());
        water.setLocalTranslation(-200, -20, 250);

        rootNode.attachChild(water);

        viewPort.addProcessor(waterProcessor);

        mainScene.attachChild(scene);
        rootNode.attachChild(mainScene);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:81,代码来源:TestSceneWater.java

示例11: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void simpleInitApp() {
        renderManager.setAlphaToCoverage(true);
        cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f));
        cam.setRotation(new Quaternion(-0.0044764364f, 0.9767943f, 0.21314798f, 0.020512417f));

//        cam.setLocation(new Vector3f(2.0606942f, 3.20342f, 6.7860126f));
//        cam.setRotation(new Quaternion(-0.017481906f, 0.98241085f, -0.12393151f, -0.13857932f));

        viewPort.setBackgroundColor(ColorRGBA.DarkGray);

        Quad q = new Quad(20, 20);
        q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(5));
        Geometry geom = new Geometry("floor", q);
        Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
        geom.setMaterial(mat);
        
        geom.rotate(-FastMath.HALF_PI, 0, 0);
        geom.center();
        geom.setShadowMode(ShadowMode.Receive);
        rootNode.attachChild(geom);

        // create the geometry and attach it
        Spatial teaGeom = assetManager.loadModel("Models/Tree/Tree.mesh.j3o");
        teaGeom.setQueueBucket(Bucket.Transparent);
        teaGeom.setShadowMode(ShadowMode.Cast);
        makeToonish(teaGeom);

        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White.mult(2));
        rootNode.addLight(al);

        DirectionalLight dl1 = new DirectionalLight();
        dl1.setDirection(new Vector3f(1, -1, 1).normalizeLocal());
        dl1.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl1);

        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
        dl.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl);

        rootNode.attachChild(teaGeom);

        FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
        CartoonEdgeFilter toon=new CartoonEdgeFilter();
        toon.setEdgeWidth(0.5f);
        toon.setEdgeIntensity(1.0f);
        toon.setNormalThreshold(0.8f);
        fpp.addFilter(toon);
        viewPort.addProcessor(fpp);
    }
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:52,代码来源:TestTransparentCartoonEdge.java

示例12: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void simpleInitApp() {
        renderManager.setAlphaToCoverage(true);
        cam.setLocation(new Vector3f(0.14914267f, 0.58147097f, 4.7686534f));
        cam.setRotation(new Quaternion(-0.0044764364f, 0.9767943f, 0.21314798f, 0.020512417f));

//        cam.setLocation(new Vector3f(2.0606942f, 3.20342f, 6.7860126f));
//        cam.setRotation(new Quaternion(-0.017481906f, 0.98241085f, -0.12393151f, -0.13857932f));

        viewPort.setBackgroundColor(ColorRGBA.DarkGray);

        Quad q = new Quad(20, 20);
        q.scaleTextureCoordinates(Vector2f.UNIT_XY.mult(5));
        Geometry geom = new Geometry("floor", q);
        Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
        geom.setMaterial(mat);

        geom.rotate(-FastMath.HALF_PI, 0, 0);
        geom.center();
        geom.setShadowMode(ShadowMode.Receive);
        TangentBinormalGenerator.generate(geom);
        rootNode.attachChild(geom);

        // create the geometry and attach it
        Spatial teaGeom = assetManager.loadModel("Models/Tree/Tree.mesh.j3o");
        teaGeom.setQueueBucket(Bucket.Transparent);
        teaGeom.setShadowMode(ShadowMode.Cast);

        AmbientLight al = new AmbientLight();
        al.setColor(ColorRGBA.White.mult(2));
        rootNode.addLight(al);

        DirectionalLight dl1 = new DirectionalLight();
        dl1.setDirection(new Vector3f(1, -1, 1).normalizeLocal());
        dl1.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl1);

        DirectionalLight dl = new DirectionalLight();
        dl.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
        dl.setColor(new ColorRGBA(0.965f, 0.949f, 0.772f, 1f).mult(0.7f));
        rootNode.addLight(dl);

        rootNode.attachChild(teaGeom);

        FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

        SSAOFilter ssao = new SSAOFilter();//0.49997783f, 42.598858f, 35.999966f, 0.39299846f
        fpp.addFilter(ssao);

        SSAOUI ui = new SSAOUI(inputManager, ssao);

        viewPort.addProcessor(fpp);
    }
 
开发者ID:shamanDevel,项目名称:ProceduralTerrain,代码行数:53,代码来源:TestTransparentSSAO.java

示例13: initialize

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
public void initialize(Application app) {
        // Used to debug the positionProvider, 
        this.rayControl = new GridRayCastControl(app, null, ColorRGBA.Green); 
        HexGrid hexGrid = app.getStateManager().getState(AbstractHexGridAppState.class);
        builder = hexGrid.getBuilder();

//        hexGrid.getGridNode().attachChild(collisionNode);
        builder.getBuilderNode().attachChild(bufferNode);

        bufferFXNode.attachChild(SkyFactory.createSky(
                app.getAssetManager(), "org/hexgridapi/assets/Textures/BrightSky.dds", false));

        /**
         * @todo consume too much fps :'(
         * @todo the water have to be split from the sky.
         */
        // we create a water processor
        SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(app.getAssetManager());
//        waterProcessor.setReflectionScene(spatial.getParent());
        waterProcessor.setReflectionScene(hexGrid.getGridNode().getParent());// rootNode is used for reflection

        // we set the water plane
        Vector3f waterLocation = new Vector3f(0, 0, 0);
        waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));
        app.getViewPort().addProcessor(waterProcessor);

        // we set wave properties
        waterProcessor.setWaterDepth(-4);         // transparency of water
        waterProcessor.setDistortionScale(0.05f); // strength of waves
        waterProcessor.setWaveSpeed(0.01f);       // speed of waves
        waterProcessor.setWaterTransparency(0.2f);
        waterProcessor.setRenderSize(256, 256);

        // we define the wave size by setting the size of the texture coordinates
        Quad quad = new Quad(200, 200);
        quad.scaleTextureCoordinates(new Vector2f(6f, 6f));

        // we create the water geometry from the quad
        water = new Geometry("water", quad);
        water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
        water.setLocalTranslation(-100, 0.01f, 125);
//        water.setShadowMode(RenderQueue.ShadowMode.Receive);
        water.setMaterial(waterProcessor.getMaterial());
    }
 
开发者ID:MultiverseKing,项目名称:HexGrid_JME,代码行数:45,代码来源:HexGridBuffer.java


注:本文中的com.jme3.scene.shape.Quad.scaleTextureCoordinates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。