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


Java Sphere.setColor方法代码示例

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


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

示例1: fillBox

import org.rajawali3d.primitives.Sphere; //导入方法依赖的package包/类
private void fillBox(Material mat){
    Sphere sphere = new Sphere(3, 25, 25);
    sphere.moveUp(2);
    sphere.setScale(0.12f);
    sphere.setMaterial(mat);
    sphere.setColor(0xFFA50000);
    getCurrentScene().addChild(sphere);

    for(int i = 0; i < 105; i++){
        Object3D tmp = sphere.clone(true,false); // clone material, no children though
        tmp.setPosition(0, 0,0);
        tmp.setScale(getRndDouble(0.04,0.25));
        tmp.moveForward(getRndDouble(-5, 5));
        tmp.moveRight(getRndDouble(-5, 5));
        tmp.moveUp(getRndDouble(-5, 5));
        getCurrentScene().addChild(tmp);
    }

    // TODO: Balken am Boden
}
 
开发者ID:selop,项目名称:dynamic-perspective-on-android,代码行数:21,代码来源:CubeRoomRenderer.java

示例2: SquareTerrain

import org.rajawali3d.primitives.Sphere; //导入方法依赖的package包/类
/**
 * Represents a Square Terrain centered at the center
 * 
 * @param divisions
 *            Matrix dimension
 * @param terrain
 *            Altitude matrix
 * @param temperature
 *            Temperature matrix
 * @param xScale
 *            the scale of the x component
 * @param zScale
 *            the scale of the z component
 */
protected SquareTerrain(int divisions, double[][] terrain, Vector3[][] normals, double[][] temperature,
		double xScale, double zScale) {
	mDivisions = divisions;
	mTerrain = terrain;
	mTemperature = temperature;
	mNormals = normals;

	mXScale = xScale;
	mZScale = zScale;

	mOneOverXScale = 1 / xScale;
	mOneOverZScale = 1 / zScale;

	for (int i = 0; i <= divisions; ++i)
		for (int j = 0; j <= divisions; ++j)
		{
			if (terrain[i][j] < mMinH)
				mMinH = terrain[i][j];
			else if (terrain[i][j] > mMaxH)
				mMaxH = terrain[i][j];

			if (temperature[i][j] < mMinT)
				mMinT = temperature[i][j];
			else if (temperature[i][j] > mMaxT)
				mMaxT = temperature[i][j];

		}

	if (debug) {
		Material mat = new Material();
		// TODO mat.useSingleColor(true);
		mV0 = new Sphere(0.2f, 8, 8);
		mV1 = new Sphere(0.2f, 8, 8);
		mV2 = new Sphere(0.2f, 8, 8);
		mNor = new Sphere(0.2f, 8, 8);
		mNorBase = new Sphere(0.2f, 8, 8);

		mV0.setMaterial(mat);
		mV1.setMaterial(mat);
		mV2.setMaterial(mat);
		mNor.setMaterial(mat);
		mNorBase.setMaterial(mat);
		mNor.setColor(Color.MAGENTA);
		mNorBase.setColor(Color.BLACK);
		mV0.setColor(Color.RED);
		mV1.setColor(Color.GREEN);
		mV2.setColor(Color.BLUE);
		this.addChild(mV0);
		this.addChild(mV1);
		this.addChild(mV2);
		this.addChild(mNor);
		this.addChild(mNorBase);

	}
}
 
开发者ID:sujitkjha,项目名称:360-Video-Player-for-Android,代码行数:70,代码来源:SquareTerrain.java


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