當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。