Main Menu
Menu

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.

Show posts Menu

Topics - denzel

#1
Support / Move object3D by touch&drag
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
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);
collition.clearTranslation();
collition.translate(simpleVector);
}

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?
#2
Support / About texture mapping
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 textureManager.addTexture("E:\\chahutexture\\chahu3.jpg", new Texture(res.openRawResource(R.raw.chahu3)));

in 3dMax

in mobile

[attachment deleted by admin]
#3
Support / What data dose JPCT-AE load with 3ds/obj?
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? ::)
#4
Support / Can't deserialize object
March 22, 2012, 08:01:08 AM
The error in logcat when i load a serialize file from an obj model
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(Logger.java:189)
03-22 14:53:05.983: E/AndroidRuntime(11550): at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:210)
03-22 14:53:05.983: E/AndroidRuntime(11550): at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
03-22 14:53:05.983: E/AndroidRuntime(11550): at com.tt.lx.ModelRenderer.onSurfaceCreated(ModelRenderer.java:139)
03-22 14:53:05.983: E/AndroidRuntime(11550): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1317)
03-22 14:53:05.983: E/AndroidRuntime(11550): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)


and when i load a serialize file from the same model but 3ds,it is all same except
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
Object3D[] models = Loader.loadSerializedObjectArray(master
.getResources().openRawResource(R.raw.room));


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

[attachment deleted by admin]
#5

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.
#6
Support / How to draw the shadow of a model
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.
:)
#7
Support / Can Light focus on model?
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?

#8
Support / About skybox again
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
SkyBox skyBox = new SkyBox("texture", "texture", "texture", "texture", "texture", "floor", 6000);
SimpleVector skyVector = new  SimpleVector(0, -2500, 0);
skyBox.setCenter(skyVector);


Rotate the camera in the world
float distance = camera.getPosition().distance(centerVector);
camera.moveCamera(Camera.CAMERA_MOVEIN, distance);
camera.rotateCameraX((float) Math.toRadians(60));
camera.moveCamera(Camera.CAMERA_MOVEOUT, distance);
camera.lookAt(centerVector);


The img:
Normal

Rotate
#9
Support / Question about skybox
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
SkyBox skyBox = new SkyBox("texture", "texture", "texture", "texture",
"texture", "floor", 2000);
skyCamera = skyBox.getWorld().getCamera();

skyCamera.moveCamera(camera.getDirection(), scale * scaleCoef);
Img Normal:

The Bad: