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


Java ObjectColorPicker类代码示例

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


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

示例1: initializeColorPicker

import org.rajawali3d.util.ObjectColorPicker; //导入依赖的package包/类
public boolean initializeColorPicker(final ObjectColorPicker picker) {
    final AFrameTask task = new AFrameTask() {
        @Override
        protected void doTask() {
            picker.initialize();
        }
    };
    return internalOfferTask(task);
}
 
开发者ID:sujitkjha,项目名称:360-Video-Player-for-Android,代码行数:10,代码来源:RajawaliRenderer.java

示例2: initScene

import org.rajawali3d.util.ObjectColorPicker; //导入依赖的package包/类
@Override
protected void initScene(){
    mPicker = new ObjectColorPicker(this);
    mPicker.setOnObjectPickedListener(this);

    mNearPos4 = new double[4];
    mFarPos4 = new double[4];
    mNearPos = new Vector3();
    mFarPos = new Vector3();
    mNewObjPos = new Vector3();
    mViewMatrix = getCurrentCamera().getViewMatrix();
    mProjectionMatrix = getCurrentCamera().getProjectionMatrix();
}
 
开发者ID:selop,项目名称:dynamic-perspective-on-android,代码行数:14,代码来源:AbstractTrackingRenderer.java

示例3: initScene

import org.rajawali3d.util.ObjectColorPicker; //导入依赖的package包/类
protected void initScene() {

        mLight = new DirectionalLight(.3f, -.3f, -1);
        mLight.setPower(1f);
        getCurrentScene().addLight(mLight);
        mLight.setPosition(-2, 1, 4);

        mPicker = new ObjectColorPicker(this);
        mPicker.setOnObjectPickedListener(this);

        ArcballCamera arcball = new ArcballCamera(mContext, ((Activity)mContext).findViewById(R.id.drawer_layout));
        arcball.setPosition(0, 0, 10);
        getCurrentScene().replaceAndSwitchCamera(getCurrentCamera(), arcball);

        Material material = new Material();
        material.enableLighting(true);
        material.setDiffuseMethod(new DiffuseMethod.Lambert());

        LoaderOBJ objParser = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.industryrobot_obj);
        try {
            objParser.parse();
            mObjectGroup = objParser.getParsedObject();
            mObjectGroup.setScale(0.0025f);
            mObjectGroup.setZ(-2);
            mObjectGroup.setY(-5);
            mPicker.registerObject(mObjectGroup);
            //getCurrentScene().addChild(mObjectGroup);
        } catch (ParsingException e) {
            e.printStackTrace();
        }

        box();

        fillBox(material);

        mObjectGroup.setMaterial(material);
    }
 
开发者ID:selop,项目名称:dynamic-perspective-on-android,代码行数:38,代码来源:CubeRoomRenderer.java

示例4: doColorPicking

import org.rajawali3d.util.ObjectColorPicker; //导入依赖的package包/类
protected void doColorPicking(ColorPickerInfo pickerInfo) {
	ObjectColorPicker picker = pickerInfo.getPicker();
	picker.getRenderTarget().bind();

	// Set background color (to Object3D.UNPICKABLE to prevent any conflicts)
	GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);

	// Configure depth testing
	GLES20.glEnable(GLES20.GL_DEPTH_TEST);
	GLES20.glDepthFunc(GLES20.GL_LESS);
	GLES20.glDepthMask(true);
	GLES20.glClearDepthf(1.0f);

	// Clear buffers used for color-picking
	GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

	// Get the picking material
	Material pickingMaterial = picker.getMaterial();

	// Can't blend picking colors
	GLES20.glDisable(GLES20.GL_BLEND);

	// Render the Skybox first (no need for depth testing)
	if (mSkybox != null && mSkybox.isPickingEnabled()) {
		GLES20.glDisable(GLES20.GL_DEPTH_TEST);
		GLES20.glDepthMask(false);
		mSkybox.renderColorPicking(mCamera, pickingMaterial);
		GLES20.glEnable(GLES20.GL_DEPTH_TEST);
		GLES20.glDepthMask(true);
	}

	// Render all children using their picking colors
	synchronized (mChildren) {
		for (int i = 0, j = mChildren.size(); i < j; ++i) {
			mChildren.get(i).renderColorPicking(mCamera, pickingMaterial);
		}
	}

	// pickObject() unbinds the renderTarget's framebuffer...
	ObjectColorPicker.pickObject(pickerInfo);
}
 
开发者ID:godstale,项目名称:VR-Defense-Game,代码行数:42,代码来源:Scene.java

示例5: initScene

import org.rajawali3d.util.ObjectColorPicker; //导入依赖的package包/类
protected void initScene() {
       mViewport = new int[] { 0, 0, getViewportWidth(), getViewportHeight() };
       mNearPos4 = new double[4];
       mFarPos4 = new double[4];
       mNearPos = new Vector3();
       mFarPos = new Vector3();
       mNewObjPos = new Vector3();
       mViewMatrix = getCurrentCamera().getViewMatrix();
       mProjectionMatrix = getCurrentCamera().getProjectionMatrix();

       mPicker = new ObjectColorPicker(this);
       mPicker.setOnObjectPickedListener(this);

       PointLight light = new PointLight();
       light.setPosition(0,0,0);
       light.setPower(10f);
       getCurrentScene().addLight(light);
       getCurrentCamera().setPosition(0, 0, 0);

       final PlanesGalore planes = new PlanesGalore();
       mMaterial = planes.getMaterial();
       mMaterial.setColorInfluence(0);
       try {
           mMaterial.addTexture(new Texture("flickrPics", R.drawable.flickrpics));
       } catch (ATexture.TextureException e) {
           e.printStackTrace();
       }

       mMaterialPlugin = planes.getMaterialPlugin();

       planes.setDoubleSided(true);
       planes.setZ(4);
       mPicker.registerObject(planes);

       planes.setScale(10f);

       getCurrentScene().addChild(planes);

       Object3D empty = new Object3D();
       getCurrentScene().addChild(empty);

       CatmullRomCurve3D path = new CatmullRomCurve3D();
       path.addPoint(new Vector3(-4, 0, -20));
       path.addPoint(new Vector3(2, 1, -10));
       path.addPoint(new Vector3(-2, 0, 10));
       path.addPoint(new Vector3(0, -4, 20));
       path.addPoint(new Vector3(5, 10, 30));
       path.addPoint(new Vector3(-2, 5, 40));
       path.addPoint(new Vector3(3, -1, 60));
       path.addPoint(new Vector3(5, -1, 70));

       final SplineTranslateAnimation3D anim = new SplineTranslateAnimation3D(path);
       anim.setDurationMilliseconds(20000);
       anim.setRepeatMode(Animation.RepeatMode.REVERSE_INFINITE);
       anim.setTransformable3D(getCurrentCamera());
       anim.setInterpolator(new AccelerateDecelerateInterpolator());
       getCurrentScene().registerAnimation(anim);
       //anim.play();

       getCurrentCamera().setLookAt(new Vector3(0, 0, 30));
}
 
开发者ID:selop,项目名称:dynamic-perspective-on-android,代码行数:62,代码来源:PlanesRenderer.java


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