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


Java ColorRGBA.randomColor方法代码示例

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


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

示例1: doCreateSpatial

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
protected Spatial doCreateSpatial(Node parent) {
    NewGeometrySettings cfg = new NewGeometrySettings();
    Sphere b = new Sphere(
        cfg.getSphereZSamples()
        , cfg.getSpherRadialSamples()
        , cfg.getSphereRadius()
        , cfg.getSphereUseEvenSlices()
        , cfg.getSphereInterior()
    );
    b.setMode(cfg.getSphereMode());
    Geometry geom = new Geometry(cfg.getSphereName(), b);
    Material mat = new Material(pm, "Common/MatDefs/Misc/Unshaded.j3md");
    ColorRGBA  c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
    mat.setColor("Color", c);
    geom.setMaterial(mat);        
    parent.attachChild(geom);
    return geom;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:NewGeometrySphereAction.java

示例2: debugPath

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
public static void debugPath(String debugId, List<Waypoint> waypoints) {
    Node path = new Node();
    Waypoint previous = null;
    ColorRGBA lineColor = ColorRGBA.randomColor();
    for (Waypoint p : waypoints) {
        Spatial box = DebugUtils.createBox(0.2f, 0.2f, 0.2f, ColorRGBA.Red);
        box.setLocalTranslation(p.getPosition());
        path.attachChild(box);

        if (previous != null) {
            Spatial arrow = DebugUtils.createArrow(previous.getPosition(), p.getPosition(), lineColor);
            arrow.scale(3);
            Spatial line = DebugUtils.createLine(previous.getPosition(), p.getPosition(), lineColor);
            path.attachChild(line);
            path.attachChild(arrow);
        }
        previous = p;
    }
    addDebugObject("debugPath_" + debugId, path, false);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:21,代码来源:DebugDynamicUtils.java

示例3: simpleInitApp

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    Quad quadMesh = new Quad(512,512);
    Geometry quad = new Geometry("Quad", quadMesh);
    quad.setQueueBucket(Bucket.Gui);

    mat = new Material(assetManager, "Common/MatDefs/Misc/ColoredTextured.j3md");
    mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
    quad.setMaterial(mat);
    guiNode.attachChildAt(quad, 0);

    nextColor = ColorRGBA.randomColor();
    prevColor = ColorRGBA.Black;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:15,代码来源:TestColoredTexture.java

示例4: simpleUpdate

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
public void simpleUpdate(float tpf){
    time += tpf;
    if (time > 1f){
        time -= 1f;
        prevColor = nextColor;
        nextColor = ColorRGBA.randomColor();
    }
    ColorRGBA currentColor = new ColorRGBA();
    currentColor.interpolate(prevColor, nextColor, time);

    mat.setColor("Color", currentColor);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:TestColoredTexture.java

示例5: doCreateSpatial

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
protected Spatial doCreateSpatial(Node parent) {
    NewGeometrySettings cfg = new NewGeometrySettings();
    Box b = new Box(cfg.getBoxX(), cfg.getBoxY(), cfg.getBoxZ());
    b.setMode(cfg.getBoxMode());
    Geometry geom = new Geometry(cfg.getBoxName(), b);
    Material mat = new Material(pm, "Common/MatDefs/Misc/Unshaded.j3md");
    ColorRGBA  c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
    mat.setColor("Color", c);
    geom.setMaterial(mat);
    parent.attachChild(geom);
    return geom;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:14,代码来源:NewGeometryBoxAction.java

示例6: doCreateSpatial

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
protected Spatial doCreateSpatial(Node parent) {
    NewGeometrySettings cfg = new NewGeometrySettings();
    Line b = new Line(cfg.getLineStart(), cfg.getLineEnd());
    b.setMode(cfg.getLineMode());
    Geometry geom = new Geometry(cfg.getLineName(), b);
    Material mat = new Material(pm, "Common/MatDefs/Misc/Unshaded.j3md");
    ColorRGBA  c = cfg.getMatRandom() ?ColorRGBA.randomColor() : cfg.getMatColor();
    mat.setColor("Color", c);
    geom.setMaterial(mat);        
    parent.attachChild(geom);
    return geom;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:14,代码来源:NewGeometryLineAction.java


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