• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OptimizedErode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jme3.terrain.noise.filter.OptimizedErode的典型用法代码示例。如果您正苦于以下问题:Java OptimizedErode类的具体用法?Java OptimizedErode怎么用?Java OptimizedErode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OptimizedErode类属于com.jme3.terrain.noise.filter包,在下文中一共展示了OptimizedErode类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createFractalGenerator

import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private Basis createFractalGenerator() {

        final FractalSum fractalSum = new FractalSum();
        fractalSum.setRoughness(getRoughness());
        fractalSum.setFrequency(getFrequency());
        fractalSum.setAmplitude(getBrushPower());
        fractalSum.setLacunarity(getLacunarity()); // make it greater than 1.0f
        fractalSum.setOctaves(getOctaves());
        fractalSum.setScale(max(min(getScale(), 1.0F), 0F)); //0.02125f
        fractalSum.addModulator((NoiseModulator) in -> ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1));

        final FilteredBasis ground = new FilteredBasis(fractalSum);

        final PerturbFilter perturb = new PerturbFilter();
        perturb.setMagnitude(0.2f);//0.119 the higher, the slower it is

        final OptimizedErode therm = new OptimizedErode();
        therm.setRadius(5);
        therm.setTalus(0.011f);

        final SmoothFilter smooth = new SmoothFilter();
        smooth.setRadius(1);
        smooth.setEffect(0.1f); // 0.7

        final IterativeFilter iterate = new IterativeFilter();
        iterate.addPreFilter(perturb);
        iterate.addPostFilter(smooth);
        iterate.setFilter(therm);
        iterate.setIterations(1);

        ground.addPreFilter(iterate);

        return ground;
    }
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:35,代码来源:RoughTerrainToolControl.java


示例2: createNoiseGenerator

import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private FilteredBasis createNoiseGenerator()
{
    FractalSum base = new FractalSum();
    base.setRoughness(0.7f);
    base.setFrequency(1.0f);
    base.setAmplitude(1.0f);
    base.setLacunarity(3.12f);
    base.setOctaves(8);
    base.setScale(0.02125f);
    base.addModulator(new NoiseModulator()
        {
            @Override public float value(float... in) 
            {
                return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
            }
        });
    
    FilteredBasis ground = new FilteredBasis(base);
    PerturbFilter perturb = new PerturbFilter();
    perturb.setMagnitude(0.119f);
    
    OptimizedErode therm = new OptimizedErode();
    therm.setRadius(5);
    therm.setTalus(0.011f);
    
    SmoothFilter smooth = new SmoothFilter();
    smooth.setRadius(1);
    smooth.setEffect(0.7f);
    
    IterativeFilter iterate = new IterativeFilter();
    iterate.addPreFilter(perturb);
    iterate.addPostFilter(smooth);
    iterate.setFilter(therm);
    iterate.setIterations(1);
    
    ground.addPreFilter(iterate);
    
    return ground;
}
 
开发者ID:jayfella,项目名称:World,代码行数:40,代码来源:Example_NoiseHeightMap.java


示例3: createFractalGenerator

import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private Basis createFractalGenerator(RoughExtraToolParams params, float weight) {
    FractalSum base = new FractalSum();
    base.setRoughness(params.roughness);
    base.setFrequency(params.frequency);
    base.setAmplitude(weight);
    base.setLacunarity(params.lacunarity <= 1 ? 1.1f : params.lacunarity); // make it greater than 1.0f
    base.setOctaves(params.octaves);
    float scale = params.scale;
    if (scale > 1.0f)
        scale = 1.0f;
    if (scale < 0)
        scale = 0;
    base.setScale(scale);//0.02125f
    base.addModulator(new NoiseModulator() {
        @Override
        public float value(float... in) {
            return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
        }
    });

    FilteredBasis ground = new FilteredBasis(base);

    PerturbFilter perturb = new PerturbFilter();
    perturb.setMagnitude(0.2f);//0.119 the higher, the slower it is

    OptimizedErode therm = new OptimizedErode();
    therm.setRadius(5);
    therm.setTalus(0.011f);

    SmoothFilter smooth = new SmoothFilter();
    smooth.setRadius(1);
    smooth.setEffect(0.1f); // 0.7

    IterativeFilter iterate = new IterativeFilter();
    iterate.addPreFilter(perturb);
    iterate.addPostFilter(smooth);
    iterate.setFilter(therm);
    iterate.setIterations(1);

    ground.addPreFilter(iterate);
    
    return ground;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:44,代码来源:RoughTerrainToolAction.java


示例4: createWorldWithNoise

import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private void createWorldWithNoise()
{
    NoiseBasedWorld newWorld = new NoiseBasedWorld(app, bulletAppState.getPhysicsSpace(), tileSize, blockSize);

    newWorld.setWorldHeight(192f);

    newWorld.setViewDistance(2);
    // newWorld.setViewDistance(14, 1, 2, 1);

    newWorld.setCacheTime(5000);

    Material terrainMaterial = createTerrainMaterial();
    newWorld.setMaterial(terrainMaterial);

    // create a noise generator
    FractalSum base = new FractalSum();

    base.setRoughness(0.7f);
    base.setFrequency(1.0f);
    base.setAmplitude(1.0f);
    base.setLacunarity(3.12f);
    base.setOctaves(8);
    base.setScale(0.02125f);
    base.addModulator(new NoiseModulator()
            {
                @Override
                public float value(float... in) {
                    return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
                }
            });

    FilteredBasis ground = new FilteredBasis(base);

    PerturbFilter perturb = new PerturbFilter();
    perturb.setMagnitude(0.119f);

    OptimizedErode therm = new OptimizedErode();
    therm.setRadius(5);
    therm.setTalus(0.011f);

    SmoothFilter smooth = new SmoothFilter();
    smooth.setRadius(1);
    smooth.setEffect(0.7f);

    IterativeFilter iterate = new IterativeFilter();
    iterate.addPreFilter(perturb);
    iterate.addPostFilter(smooth);
    iterate.setFilter(therm);
    iterate.setIterations(1);

    ground.addPreFilter(iterate);

    newWorld.setFilteredBasis(ground);

    this.world = newWorld;
}
 
开发者ID:jayfella,项目名称:TerrainWorld,代码行数:57,代码来源:Main.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DuplicateMessageException类代码示例发布时间:2022-05-23
下一篇:
Java QueueScheduler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap