www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: CarlosMB89 on December 03, 2014, 01:41:02 pm

Title: Android Operative System goes very slow when I rotate the camera
Post by: CarlosMB89 on December 03, 2014, 01:41:02 pm
Hello I have a problem. I'm developing an app with a 3D view integrated into the activity. My problem is that when I move/rotate the camera the devices goes very very slow when a short time has spent.

I don`t know what causes the problem.

the code I use is the next: (I get the camera from the world world.getCamera())

public void rotate camera(moveX,moveY)
{
                         camera.moveCamera(Camera.CAMERA_MOVEIN,camDist);
   
         
         camera.rotateY((float)Math.toRadians(moveX));
         camera.rotateX((float) Math.toRadians(moveY));
         
         
         camera.moveCamera(Camera.CAMERA_MOVEOUT, camDist);
         camera.lookAt(cameraLookPosition);

}

I call this function by the main thread, when I touch the screen.

Any suggestion??
Title: Re: Device goes very slow when I move/rotate the camera
Post by: EgonOlsen on December 03, 2014, 08:37:27 pm
I not sure what the screen shot is supposed to tell us nor what you mean by "device goes very very slow"!? What "goes slow"? Does the fps drop, does the movement become itself become slow or... ???

The method calls that you have posted all run at constant speed and don't depends in any way on any current state. They can't be the reason for anything becoming slow.
Title: Re: Device goes very slow when I move/rotate the camera
Post by: CarlosMB89 on December 03, 2014, 11:45:19 pm
Hello EgonOlsen, sorry if I didn`t explain myself so well. I mean that when I rotate the camera (I rotate it when I touch the screen) the fps goes down to 10 and the Android Operative System goes very slow, for example, the drop down Android menu goes very slow as well. It only happens when I rotate the camera. When I close the app, the system come back to normality.

I don,t know why it happens...it's like I would have a memory leak but I only rotate the camera....if I do a zoom or translation in the camera the system goes normal.

Do you know what can be the reason??

Thanks in advance
Title: Re: Device goes very slow when I move/rotate the camera
Post by: EgonOlsen on December 03, 2014, 11:55:12 pm
Unless this rotation causes a huge amount of objects to appear that weren't visible before, i don't see any reason for this behaviour. The calls that you've posted can't be responsible for this on their own. Does the log output tells you something?
Title: Re: Device goes very slow when I move/rotate the camera
Post by: CarlosMB89 on December 04, 2014, 01:21:25 am
No, the log doesn't send any message. It is very strange because only happens when I rotate the camera around 45º degrees....if I rotate the camera again to the initial position I set at the begining the app comes back to the normality :S
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: EgonOlsen on December 04, 2014, 08:37:59 am
I don't see why this should happen unless your scene shows a lot more objects with the camera rotated by 45°. Is that the case?

BTW: Which device are we actually talking about?
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: EgonOlsen on December 04, 2014, 08:22:31 pm
Off topic: Your email address bounces with "user unknown". I'm getting returned mails when the forum tries to send notifications to your address.
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: CarlosMB89 on December 06, 2014, 08:26:39 am
No my scene shows the same number of objects. Im using a nexus 10,  I tried it at other devices and the effect is lower than nexus 10  but it appear as well.:s
Maybe any other way to rotate the camera?

Sorry my email is carlos.mateo@upm.es   .....I forgot to write  the point ....

Thank you very much!!!
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: EgonOlsen on December 06, 2014, 10:17:02 am
It has nothing to do with rotating the camera itself. Rotating the camera is a trivial operation. If the number of objects doesn't change, all i can think of is a caching issue. Are you using very large textures?
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: CarlosMB89 on December 12, 2014, 11:44:25 pm
No, I only use the texturized robot you can see in the image I posted in the first reply. I load it from a serialized file created by the jpct serializer plugin for eclipse. But that effect happens aswell if oone object is loaded to the scene. Do you know any solution I could try to find the problem??

Thanks in advance
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: EgonOlsen on December 13, 2014, 08:41:16 am
Can you provide a test case for me that shows the problem. I've never experienced anything like nor have i an idea what might cause it without seeing it for myself.
Title: Re: Android Operative System goes very slow when I rotate the camera
Post by: EgonOlsen on December 13, 2014, 11:05:58 am
Btw: your mail address still bounces...