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 - tinhtinhcd

Pages: [1]
1
Support / how to lazyload
« on: August 14, 2017, 06:06:50 am »
Hi,
I have problem with performance when try to load a big file size in the screen.
I have 2 screen,
screen 1 have a button, when i click this button it will go to screen 2 to load object but it take 2-3 second to go next screen.
is there any way that i can go to the 2nd screen first and load the render for surfaceView later.

2
Support / multi object in one sigle file.
« on: August 04, 2017, 12:56:41 pm »
Hi,

I have an obj file with many object inside (about 67 object).
currently, when load from obj i made the fist object as parent and add the other as child to rotate and zoom.
the problem is when i set parent as center camera and rotate, it will rotate around the parent object, not the middle of them.
how can I rotate around the middle of them because I don't know which object is in the center of all object.


3
Support / glPushMatrix() & glPopMatrix()
« on: May 26, 2017, 09:08:44 am »
I have to rotate object around the axis

Code: [Select]
public void onDrawFrame(GL10 gl) {
....
parentObj.rotateAxis(new SimpleVector(mPquart[1],mPquart[2],mPquart[3]),mPquart[0]);
...
}

The problem is mPquart is Quaternion and get from SensorManager.
So, I need something like glPushMatrix() & glPopMatrix() to make the object stable when I don't rotate the phone.
How can I do it.

I try gl.glPushMatrix(); and gl.glPopMatrix(); but nothing happen.

4
Support / How to load texture inside file .obj.
« on: May 19, 2017, 10:57:40 am »
Hi,

My app load object from file .obj.
Inside the .obj also contain texture

Code: [Select]
vt  1.000000 0.011329 0.000000
vt  1.000000 0.011329 0.000000
vt  1.000000 0.024390 0.000000
vt  1.000000 0.024390 0.000000
vt  1.000000 0.024390 0.000000
vt  1.000000 0.975610 0.000000
vt  1.000000 0.975610 0.000000


how can i load that texture.

5
Support / Child Object go on wrong direction when rotate Parent.
« on: May 17, 2017, 01:43:48 pm »
Hi, my app have 2 object.
The object2 is a child of object1.

At the first time run app. I click on child and call translate, it go on the correct direction that i that my finger move.
After I rotate the parent, it go on the opposite way with my finger.

I only want the child move along with it out Axis, not in work Axis.
 
in pic1 it correct, in pic2 it wrong direction.

here is my code:

Code: [Select]
public void onDrawFrame(GL10 gl) {
SimpleVector dir = Interact2D.reproject2D3DWS(cam, fragment3D.fb, (int) fragment3D.xPos, (int)fragment3D.yPos).normalize();
world.calcMinDistanceAndObject3D(world.getCamera().getPosition(), dir, 10000F);

if (this.hasToCreateBuffer) {
hasToCreateBuffer = false;
fb = new FrameBuffer(w, h);
}
if (object2.wasTargetOfLastCollision()){
SimpleVector direction = new SimpleVector(dis*scale,0,0);
object1.translate(direction);
}else{
if (touchTurn != 0) {
object1.rotateY(touchTurn);
touchTurn = 0;
}
if (touchTurnUp != 0) {
object1.rotateX(touchTurnUp);
touchTurnUp = 0;
}
}
updateFrame();
}

Pages: [1]