我正在尝试制作一个加载 3d 对象的应用程序。
当我加载这个对象(http://rgcouto.net/alexandre/COKE/fineObj/)时,一切正常。截图:http ://rgcouto.net/alexandre/COKE/Screenshot_2013-01-10-15-04-42.png
但是当我尝试加载从搅拌机导出的我的对象(http://rgcouto.net/alexandre/COKE/myObj/)时,纹理没有出现并且对象很暗.. 截图:http ://rgcouto.net /alexandre/COKE/Screenshot_2013-01-10-15-02-27.png
我做错了什么?我必须做什么,才能使我的对象出现纹理?
我的混合文件:http://rgcouto.net/alexandre/COKE/blend/
我的渲染器:
public class ObjRenderer extends RajawaliRenderer {
private static final String TAG = "renderer";
private BaseObject3D mObjectGroup;
Number3D mAccValues;
public ObjRenderer(Context context) {
super(context);
setFrameRate(60);
mAccValues = new Number3D();
}
protected void initScene() {
// mLight = new DirectionalLight(1, -1, 1);
// mLight.setPower(.9f);
DirectionalLight light = new DirectionalLight(0, 0, 1);
light.setPower(1);
// light.setPosition(0, 20, -20);
// light.setLookAt(0, 0, 0);
mCamera.setPosition(0, 0, -14);
mCamera.setLookAt(0, 0, 0);
ObjParser objParser = new ObjParser(mContext.getResources(),
mTextureManager, R.raw.camaro_obj);
objParser.parse();
mObjectGroup = objParser.getParsedObject();
Log.d(TAG, "carreguei");
DiffuseMaterial material = new DiffuseMaterial();
material.setUseColor(true);
mObjectGroup.setMaterial(material);
mObjectGroup.addLight(light);
// mObjectGroup.setScale(3);
addChild(mObjectGroup);
// mCameraAnim = new RotateAnimation3D(Axis.Y, 360);
// mCameraAnim.setDuration(8000);
// mCameraAnim.setRepeatCount(Animation3D.INFINITE);
// mCameraAnim.setTransformable3D(mObjectGroup);
}
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
super.onSurfaceCreated(gl, config);
// mCameraAnim.start();
}
public void onDrawFrame(GL10 glUnused) {
super.onDrawFrame(glUnused);
mObjectGroup.setRotY(mObjectGroup.getRotY() + 1);
// mObjectGroup.setRotation(mAccValues.y, mAccValues.x, mAccValues.z);
}}
问候亚历克斯