Вопрос

        public void initScene() {
            ALight light = new DirectionalLight(-1, 0, -1);
            light.setPower(2);
            getCurrentCamera().setPosition(0, 0, 7);
            getCurrentCamera().setLookAt(0, 0, 0);



            try {
                Cube cube = new Cube(1);
                DiffuseMaterial material = new DiffuseMaterial();
                material.addTexture(new Texture(R.drawable.rajawali_tex));
                cube.setMaterial(material);
                cube.addLight(light);
                addChild(cube);

                Vector3 axis = new Vector3(3, 1, 6);
                axis.normalize();

                RotateAnimation3D anim = new RotateAnimation3D(axis, 360);
                anim.setDuration(8000);
                anim.setRepeatMode(RepeatMode.INFINITE);
                anim.setInterpolator(new AccelerateDecelerateInterpolator());
                anim.setTransformable3D(cube);
                registerAnimation(anim);
                anim.play();    
            } 
            catch (TextureException e) {
                e.printStackTrace();
            }
        }

I see that removing the texture and light from the cube actually causes Rajawali to go down. I am wondering how to render the cube as a wire frame not a textured object in this case. Does anyone know how a wire frame might be rendered?

Thanks in advance...

Это было полезно?

Решение

cube.setDrawingMode(1);

or

cube.setDrawingMode(2);

this should do it

Другие советы

You need to use a default material as well as set the drawing mode to lines, eg:

mSphere = new Sphere(1, 24, 24);

Material material = new Material();

mSphere.setMaterial(material);      
mSphere.setDrawingMode(GLES20.GL_LINES);

getCurrentScene().addChild(mSphere);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top