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


Java LoaderAWD.getParsedObject方法代码示例

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


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

示例1: initScene

import org.rajawali3d.loader.LoaderAWD; //导入方法依赖的package包/类
@Override
        protected void initScene() {
            try {
                mLight = new DirectionalLight(0.1f, -1.0f, -1.0f);
                mLight.setColor(1.0f, 1.0f, 1.0f);
                mLight.setPower(1);
                getCurrentScene().addLight(mLight);

                final LoaderAWD parser = new LoaderAWD(mContext.getResources(), mTextureManager, R.raw.head_object_new);
                parser.parse();
                mMonkey = parser.getParsedObject();
                mMonkey.setScale(0.005f);
                //mMonkey.setZ(-2f);
//                getCurrentScene().addChild(mMonkey);

                int[] resourceIds = new int[]{R.drawable.posx, R.drawable.negx,
                        R.drawable.posy, R.drawable.negy, R.drawable.posz,
                        R.drawable.negz};

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

                CubeMapTexture envMap = new CubeMapTexture("environmentMap",
                        resourceIds);
                envMap.isEnvironmentTexture(true);
                material.addTexture(envMap);
                material.setColorInfluence(0);
                mMonkey.setMaterial(material);

                LoaderOBJ objParser1 = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.glasses_obj);
                objParser1.parse();
                mGlasses = objParser1.getParsedObject();
                mGlasses.setScale(0.005f);
                //mGlasses.setZ(-0.2f);
                mGlasses.setZ(0.3f);
                mGlasses.rotate(Vector3.Axis.X, -90.0f);

                LoaderOBJ objParser2 = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.hair_band_obj);
                objParser2.parse();
                mHairBand = objParser2.getParsedObject();
                mHairBand.setScale(0.006f);
                mHairBand.setY(0.27f);
                mHairBand.setZ(-0.25f);
                mHairBand.rotate(Vector3.Axis.X, -90.0f);

                LoaderOBJ objParser3 = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.moustache_obj);
                objParser3.parse();
                mMoustache = objParser3.getParsedObject();
                mMoustache.setScale(0.007f);
                mMoustache.setY(-0.25f);
                mMoustache.setZ(0.3f);
                mMoustache.rotate(Vector3.Axis.X, -90.0f);

                mContainer = new Object3D();
                mContainer.addChild(mMonkey);
                mContainer.addChild(mGlasses);
                mContainer.addChild(mHairBand);
                mContainer.addChild(mMoustache);
                getCurrentScene().addChild(mContainer);
                //getCurrentCamera().setZ(20);

            } catch (Exception e) {
                e.printStackTrace();
            }

            // -- set the background color to be transparent
            // you need to have called setGLBackgroundTransparent(true); in the activity
            // for this to work.
            getCurrentScene().setBackgroundColor(0);
        }
 
开发者ID:SimonCherryGZ,项目名称:face-landmark-android,代码行数:72,代码来源:CameraConnectionFragment.java

示例2: makeMothership

import org.rajawali3d.loader.LoaderAWD; //导入方法依赖的package包/类
private void makeMothership() {
    try {
        CatmullRomCurve3D path;

        LoaderAWD loader = new LoaderAWD(mContext.getResources(),
                mRenderer.getTextureManager(), R.raw.capital);
        loader.parse();

        Material capitalMaterial = new Material();
        capitalMaterial.setDiffuseMethod(new DiffuseMethod.Lambert());
        capitalMaterial.setColorInfluence(0);
        capitalMaterial.enableLighting(true);
        capitalMaterial.addTexture(new Texture("capitalTex", R.drawable.hullw));
        capitalMaterial.addTexture(new NormalMapTexture("capitalNormTex", R.drawable.hulln));

        mMothershipObj = loader.getParsedObject();
        mMothershipObj.setMaterial(capitalMaterial);
        mMothershipObj.setScale(5);
        mMothershipObj.enableLookAt();
        mRenderer.getCurrentScene().addChild(mMothershipObj);

        path = new CatmullRomCurve3D();
        path.addPoint(new Vector3(0, 15, 100));
        path.addPoint(new Vector3(-100, 15, 0));
        path.addPoint(new Vector3(0, 15, -100));
        path.addPoint(new Vector3(100, 15, 0));
        path.isClosedCurve(true);

        mMothershipAnim = new SplineTranslateAnimation3D(path);
        mMothershipAnim.setDurationMilliseconds(ANIM_DURATION);
        mMothershipAnim.setRepeatMode(Animation.RepeatMode.INFINITE);
        mMothershipAnim.setOrientToPath(true);
        mMothershipAnim.setTransformable3D(mMothershipObj);
        mRenderer.getCurrentScene().registerAnimation(mMothershipAnim);
        mMothershipAnim.play();

        mMothership = new Mothership(mMothershipObj);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:godstale,项目名称:VR-Defense-Game,代码行数:42,代码来源:World.java


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