jPCT-AE - a 3d engine for Android > Support

Too late rendering

(1/3) > >>

bLAZY:
Hi,

I'm trying to do a game where object moves "into the screen" and object is always in the middle. Some hurdles will be showed and I want they appear also in the middle and become more and more bigger when are closer. It's situation almost like in AlienRunner. My problem is that hurdles appear too late, suddenly on the scrren, when they are too close. As it's initial phase I use only primitives as hurdles so they are not big things to render. What could be the problem?

EgonOlsen:
Try to adjust http://www.jpct.net/jpct-ae/doc/com/threed/jpct/World.html#setClippingPlanes(float, float)

bLAZY:
Thanks a lot. Now I see difference. Unfortunately I test it on emulator so I have hope it will work much better on real device.

EgonOlsen:
My opinion on the emulator: http://www.jpct.net/wiki/index.php/Using_the_emulator

bLAZY:
Finally I found problem, when I removed SkyBox everything show up very fast and I can control it with mentioned Config.farPlane.
But now problem with SkyBox. To be honest I don't need all the sky. Better way for me could be some "static" background in every frame. Why "static"? I'd like to change it with some preset time (to look like blinking).
And this is next thing I can't deal with. I tried this:


--- Code: ---frameBuffer.clear();
frameBuffer.blit(sky,0,0,0,0,512,512,FrameBuffer.OPAQUE_BLITTING);

world.renderScene(frameBuffer);
world.draw(frameBuffer);

frameBuffer.display();
--- End code ---

sky is the texture added to TextureManager and has size 512x512. But I get:


--- Code: ---01-28 19:03:39.921: E/AndroidRuntime(893): FATAL EXCEPTION: GLThread 8
01-28 19:03:39.921: E/AndroidRuntime(893): java.lang.NullPointerException
01-28 19:03:39.921: E/AndroidRuntime(893): at com.threed.jpct.GLRenderer.blit(GLRenderer.java:1453)
01-28 19:03:39.921: E/AndroidRuntime(893): at com.threed.jpct.GLRenderer.execute(GLRenderer.java:1892)
01-28 19:03:39.921: E/AndroidRuntime(893): at com.threed.jpct.FrameBuffer.blit(FrameBuffer.java:587)
01-28 19:03:39.921: E/AndroidRuntime(893): at my.game.GameActivity$MyRenderer.onDrawFrame(GameActivity.java:870)
01-28 19:03:39.921: E/AndroidRuntime(893): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
01-28 19:03:39.921: E/AndroidRuntime(893): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
--- End code ---

How could I fix it to have this background?

Navigation

[0] Message Index

[#] Next page

Go to full version