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


Java Quad.updateGeometry方法代码示例

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


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

示例1: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    flyCam.setMoveSpeed(20);
    Sphere sphereMesh = new Sphere(32, 32, 1);
    sphereMesh.setTextureMode(Sphere.TextureMode.Projected);
    sphereMesh.updateGeometry(32, 32, 1, false, false);
    addMesh("Sphere", sphereMesh, new Vector3f(-1, 0, 0));

    Quad quadMesh = new Quad(1, 1);
    quadMesh.updateGeometry(1, 1);
    addMesh("Quad", quadMesh, new Vector3f(1, 0, 0));

    Mesh strip = createTriangleStripMesh();
    addMesh("strip", strip, new Vector3f(0, -3, 0));
    
    DirectionalLight dl = new DirectionalLight();
    dl.setDirection(new Vector3f(1, -1, -1).normalizeLocal());
    dl.setColor(ColorRGBA.White);
    rootNode.addLight(dl);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:TestTangentGen.java

示例2: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    // create a simple plane/quad
    Quad quadMesh = new Quad(1, 1);
    quadMesh.updateGeometry(1, 1, true);

    Geometry quad = new Geometry("Textured Quad", quadMesh);
    assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/town.zip",
                       HttpZipLocator.class);

    TextureKey key = new TextureKey("grass.jpg", false);
    key.setGenerateMips(true);
    Texture tex = assetManager.loadTexture(key);

    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setTexture("ColorMap", tex);
    quad.setMaterial(mat);

    float aspect = tex.getImage().getWidth() / (float) tex.getImage().getHeight();
    quad.setLocalScale(new Vector3f(aspect * 1.5f, 1.5f, 1));
    quad.center();

    rootNode.attachChild(quad);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:TestOnlineJar.java

示例3: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    // create a simple plane/quad
    Quad quadMesh = new Quad(1, 1);
    quadMesh.updateGeometry(1, 1, true);

    Geometry quad = new Geometry("Textured Quad", quadMesh);

    assetManager.registerLocator("http://www.jmonkeyengine.com/wp-content/uploads/2010/09/",
                            UrlLocator.class);
    TextureKey key = new TextureKey("planet-2.jpg", false);
    key.setGenerateMips(true);
    Texture tex = assetManager.loadTexture(key);

    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setTexture("ColorMap", tex);
    quad.setMaterial(mat);

    float aspect = tex.getImage().getWidth() / (float) tex.getImage().getHeight();
    quad.setLocalScale(new Vector3f(aspect * 1.5f, 1.5f, 1));
    quad.center();

    rootNode.attachChild(quad);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:TestUrlLoading.java

示例4: simpleInitApp

import com.jme3.scene.shape.Quad; //导入方法依赖的package包/类
@Override
    public void simpleInitApp() {
        BitmapText txt = guiFont.createLabel("Left: HW Mips");
        txt.setLocalTranslation(0, settings.getHeight() - txt.getLineHeight() * 4, 0);
        guiNode.attachChild(txt);

        txt = guiFont.createLabel("Right: AWT Mips");
        txt.setLocalTranslation(0, settings.getHeight() - txt.getLineHeight() * 3, 0);
        guiNode.attachChild(txt);

        // create a simple plane/quad
        Quad quadMesh = new Quad(1, 1);
        quadMesh.updateGeometry(1, 1, false);
        quadMesh.updateBound();

        Geometry quad1 = new Geometry("Textured Quad", quadMesh);
        Geometry quad2 = new Geometry("Textured Quad 2", quadMesh);

        Texture tex = assetManager.loadTexture("Interface/Logo/Monkey.png");
        tex.setMinFilter(Texture.MinFilter.Trilinear);

        Texture texCustomMip = tex.clone();
        Image imageCustomMip = texCustomMip.getImage().clone();
        MipMapGenerator.generateMipMaps(imageCustomMip);
        texCustomMip.setImage(imageCustomMip);

        Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat1.setTexture("ColorMap", tex);

        Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat2.setTexture("ColorMap", texCustomMip);

        quad1.setMaterial(mat1);
//        quad1.setLocalTranslation(1, 0, 0);

        quad2.setMaterial(mat2);
        quad2.setLocalTranslation(1, 0, 0);

        rootNode.attachChild(quad1);
        rootNode.attachChild(quad2);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:TestMipMapGen.java


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