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

Messages - denzel

#1
Support / Re: Move object3D by touch&drag
May 11, 2012, 11:36:19 AM
Sorry i cannt catch your means.
To get the camera actual axis in world space:
SimpleVector cPosition = camera.getPosition();
SimpleVector cXA = camera.getXAxis();
SimpleVector cXAA = new SimpleVector(cPosition.x * cXA.x, cPosition.y * cXA.y, cPosition.z * cXA.z);

That's the camera's actual X axis?
And when i get the y-axis, z-axis and multiply with xx,yy,zz,there are there SimpleVectors,how to translate the model?@@
#2
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?
#3
Do you mean to "pick" a object3d?
if so ,search mouse pick in forum for more details
set the collision mode in your object3d and then
SimpleVector simpleVector = Interact2D.reproject2D3DWS(
camera, frameBuffer, touchX, touchY).normalize();
Object[] ii = world.calcMinDistanceAndObject3D(camera
.getPosition(), simpleVector, 10000);


in ii[1] that's the object3d which be touched or null if nothing is been touched.

------------------------
Sorry i didnot get your question after a review
#4
Support / Re: About texture mapping
April 26, 2012, 11:37:13 AM
Quote from: EgonOlsen on April 26, 2012, 10:24:23 AM
Marke sure that environment mapping isn't enabled on you objects. About the second problem....i'm not sure. It doesn't like a 512*512 texture. Make sure that you are loading the texture from raw or assets, not from drawable.

yes...the whole world is empty except this only model.
and the second ,it's 128x128,all my texture is load by TextureManager(String, Texture).
Or can i email you my obj/mtl/image/code to you and help me to check where am i wrong?
Really appreciate it.
#5
Support / Re: About texture mapping
April 26, 2012, 04:10:41 AM
Quote from: vickt on April 26, 2012, 03:32:03 AM
The texture dimensions should be a power of 2.

Instead of using 461, either move up to 512x512 or down to 256 by 256.

yes, i use 512x512, scale it just for attachments limit
#6
Support / Re: About texture mapping
April 26, 2012, 03:05:48 AM
i try another model for a test.
why the texture looks like be cover in the right?
in 3dMax
int mobile


[attachment deleted by admin]
#7
Support / Re: About texture mapping
April 26, 2012, 02:39:49 AM
and the image use for texture


[attachment deleted by admin]
#8
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]
#9
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? ::)
#10
Support / Re: Can't deserialize object
March 23, 2012, 03:21:49 AM
 :)
alright,im going to the last beta
#11
Support / Re: Touch Listener
March 22, 2012, 09:48:49 AM
Quote from: Thomas. on March 19, 2012, 05:32:19 PM
Try this app, when you long tap on box, you can move with it. Sources are also available ;)

the sources and application url: 404 Not Found  :(
#12
Q-1 is done!
Yes,there's a way to do this ;D,i found it!
Just load the texture with the name exactly as same as the texture'name used in the model, it's case-sensitive i guess.
#13
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]
#14

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.
#15
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.
:)