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