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


Java Sphere类代码示例

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


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

示例1: createPhotoSphereWithTexture

import org.rajawali3d.primitives.Sphere; //导入依赖的package包/类
private static Sphere createPhotoSphereWithTexture(ATexture texture) {

        Material material = new Material();
        material.setColor(0);

        try {
            material.addTexture(texture);
        } catch (ATexture.TextureException e) {
            throw new RuntimeException(e);
        }

        Sphere sphere = new Sphere(50, 64, 32);
        sphere.setScaleX(-1);
        sphere.setMaterial(material);


        return sphere;
    }
 
开发者ID:sujitkjha,项目名称:360-Video-Player-for-Android,代码行数:19,代码来源:MyRenderer.java

示例2: 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

示例3: initScene

import org.rajawali3d.primitives.Sphere; //导入依赖的package包/类
@Override
protected void initScene() {

    mMediaPlayer = MediaPlayer.create(getContext(), R.raw.test);
    //mMediaPlayer = MediaPlayer.create(getContext(), Uri.parse("http://nepal.cloudapp.net/video_portal/video.mp4"));
    mMediaPlayer.setLooping(true);


    mVideoTexture = new StreamingTexture("sintelTrailer", mMediaPlayer);
    Log.d("TextureSet","Texture");
    Material material = new Material();
    material.setColorInfluence(0);
    try {
        material.addTexture(mVideoTexture);
    } catch (ATexture.TextureException e) {
        e.printStackTrace();
    }

    Sphere sphere = new Sphere(50, 64, 32);
    sphere.setScaleX(-1);
    sphere.setMaterial(material);

    getCurrentScene().addChild(sphere);

    getCurrentCamera().setPosition(Vector3.ZERO);

    getCurrentCamera().setFieldOfView(75);

    EllipticalOrbitAnimation3D camAnim = new EllipticalOrbitAnimation3D(
            new Vector3(3, 2, 10), new Vector3(1, 0, 8), 0, 359);
    camAnim.setDurationMilliseconds(20000);
    camAnim.setRepeatMode(Animation.RepeatMode.INFINITE);
    camAnim.setTransformable3D(getCurrentCamera());
    getCurrentScene().registerAnimation(camAnim);
    camAnim.play();

    mMediaPlayer.start();


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

示例4: 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

示例5: initScene

import org.rajawali3d.primitives.Sphere; //导入依赖的package包/类
@Override
protected void initScene() {

    Sphere sphere = createPhotoSphereWithTexture(new Texture("photo", R.drawable.office));


    getCurrentScene().addChild(sphere);

    getCurrentCamera().setPosition(Vector3.ZERO);
    getCurrentCamera().setFieldOfView(100);

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


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