Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - denzel

Pages: [1]
Support / Move object3D by touch&drag
« on: May 11, 2012, 05:10:13 am »
Which i need is to move an model along the screen X-AXIS and Y-AXIS but never Z-AXIS by drag
Now I can get the model in the screen which is been touched, and i can move them by drag with this code
Code: [Select]
SimpleVector simpleVector = Interact2D.reproject2D3D(camera, frameBuffer, x, y).normalize();
if(collition != null){
SimpleVector cPosition = camera.getPosition();
int cz = (int) cPosition.z;
int a = (int) (z_plane - cz / simpleVector.z);
int xx = (int) (cPosition.x + a * simpleVector.x);
int yy = (int)(cPosition.y + a * simpleVector.y);
simpleVector = new SimpleVector(xx, yy, z_plane);
But it donot go well if the camera has a rotation, i think it's about the z_plane i always support it to 10
What should i do to fix this?

Support / About texture mapping
« on: April 26, 2012, 02:37:40 am »
I have an obj model witch has a texure, but when i load the texture with the all-name into textureManager and load the model,it looks not right.

load texture code
Code: [Select]
textureManager.addTexture("E:\\chahutexture\\chahu3.jpg", new Texture(res.openRawResource(R.raw.chahu3)));
in 3dMax

in mobile

[attachment deleted by admin]

Support / What data dose JPCT-AE load with 3ds/obj?
« on: March 27, 2012, 10:43:44 am »
Sure that AE will load polygonal mesh data and texture information, and any others? e.g.metal material/Specular/Diffuse...
If no metal material/specular/Diffuse, there's a way to do it myself? ::)

Support / Can't deserialize object
« on: March 22, 2012, 08:01:08 am »
The error in logcat when i load a serialize file from an obj model
Code: [Select]
03-22 14:53:05.983: E/AndroidRuntime(11550): java.lang.RuntimeException: [ 1332399185965 ] - ERROR: Can't deserialize object: [ 1332399185963 ] - ERROR: A texture with the name '__obj-Color:255/255/255' has been declared twice!
03-22 14:53:05.983: E/AndroidRuntime(11550): at com.threed.jpct.Logger.log(
03-22 14:53:05.983: E/AndroidRuntime(11550): at com.threed.jpct.DeSerializer.deserialize(
03-22 14:53:05.983: E/AndroidRuntime(11550): at com.threed.jpct.Loader.loadSerializedObject(
03-22 14:53:05.983: E/AndroidRuntime(11550): at
03-22 14:53:05.983: E/AndroidRuntime(11550): at android.opengl.GLSurfaceView$GLThread.guardedRun(
03-22 14:53:05.983: E/AndroidRuntime(11550): at android.opengl.GLSurfaceView$

and when i load a serialize file from the same model but 3ds,it is all same except
Code: [Select]
ERROR: A texture with the name '__3ds-Color:255/255/255' has been declared twice!
And i didnot load any texture yet.What's wrong?

The code
Code: [Select]
Object3D[] models = Loader.loadSerializedObjectArray(master

When i use 3ds without serialize, it' all right.
The model in 3ds:

[attachment deleted by admin]

Support / Questions about texture&transparent&objectTouchEvent
« on: March 22, 2012, 06:45:23 am »

Let`s go. :) :)

Q-1:There is a scene has so much models with textures,what should i do to map the texture to the right model?I guess there`s a way besides TextureManager.add(...) & Object3D.setTexture(...),but i cant find it.

Q-2:In the scene there are some models are translucent, when i use Object.setTransparency(int trans), it works.But after that i use mergeAll to an Object3D,the translucent is gone.Why?

Q-3:When i touch the screen how can i know which model is being touched?I need to move the model to a position.

Support / How to draw the shadow of a model
« on: March 05, 2012, 10:01:00 am »
How to draw the shadow of a model?
And the shadow should like in the real world when the model rotate/translation...
Or should I implement it with opengl-es manually?

Great appreciate for your reply.

Support / Can Light focus on model?
« on: February 29, 2012, 10:46:19 am »
Just like a light focus on a actor in the stage.
I think the Light in JPCE-AE is a pointolite like the sun, is there a way to make a Cone-Light?

Support / About skybox again
« on: February 26, 2012, 09:36:28 am »
I add a skybox in my demo,and move the skybox-center.
But when i rotate the wolrd's camera,my model looks like under the skybox, why?
Am i mistake sth?
the code:
Build a skybox and move its center to make my model looks like is in the floor
Code: [Select]
SkyBox skyBox = new SkyBox("texture", "texture", "texture", "texture", "texture", "floor", 6000);
Code: [Select]
SimpleVector skyVector = new  SimpleVector(0, -2500, 0);

Rotate the camera in the world
Code: [Select]
float distance = camera.getPosition().distance(centerVector);
camera.moveCamera(Camera.CAMERA_MOVEIN, distance);
camera.rotateCameraX((float) Math.toRadians(60));
camera.moveCamera(Camera.CAMERA_MOVEOUT, distance);

The img:


Support / Question about skybox
« on: February 25, 2012, 08:29:17 am »
When i move out the skybox's world-camera, it's all right at the beginning,but when move out for a distance, there's a blackground in the window.
Am i mistake sth?
And what should i do to move the model to the skybox's center?
Your reply will be very appreciate.
The code of the skybox
Code: [Select]
SkyBox skyBox = new SkyBox("texture", "texture", "texture", "texture",
"texture", "floor", 2000);
skyCamera = skyBox.getWorld().getCamera();
Code: [Select]
skyCamera.moveCamera(camera.getDirection(), scale * scaleCoef);Img Normal:

The Bad:

Pages: [1]