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.

Messages - K24A3

Pages: 1 [2] 3 4 ... 16
Support / Re: Help with setting image as background and 3d object on top
« on: December 10, 2012, 02:08:47 pm »
Assuming the camera doesn't move, you could simply create a plane with a power of 2 texture with the excess pixels padded with black and use the Interact2D class to position the plane in view of the camera.

Support / Re: JPCT draw human with move
« on: December 10, 2012, 02:04:51 pm »
Another solution is to create the animations in blender and export the model multiple times at each major movement of the animation. Export say 6 different positions of the animation from start to finish and load each mesh using the Animation class in jPCT when creating the model. jPCT will automatically calculate the vector positions during each frame at the assumed position between each of those 6 animation models using a float value from 0f to 1f.

Hopefully that makes sense :p It may sounds complicated but it's not once you understand how it works.

Projects / Re: Thinking about some RPG..Android version.
« on: December 06, 2012, 01:58:05 pm »
Looking good! Any chance you could post up or send an APK of it's current state? I'd like to compare the framerate performance against an app I made in jPCT

Support / Re: jpct-ae for iOS
« on: December 06, 2012, 01:36:41 pm »
It's not just the iOS API and OpenGL adaption, the quality of J2ObjC's code conversion is in question as well so the conversion may introduce many problems that may be difficult and tiresome to track down. Plus any future changes done in jPCT-AE would need to be duplicated in jPCT-iOS, tested, patched, etc..

I mean it would be nice having an iOS version but I've had to convert a large amount of code from one platform to another (C++ MFC to C# .NET) and was something that introduced a lot hair pulling and headaches :p

Support / Re: jpct-ae for iOS
« on: December 04, 2012, 01:31:59 pm »
"J2ObjC does not provide any sort of platform-independent UI toolkit, nor are there any plans to do so in the future. iOS UI code needs to be written in Objective-C or Objective-C++ using Apple's iOS SDK (Android UIs using Android's API, web app UIs using GWT, etc.)."

..which means it would be a big job converting jPCT to iOS. I think Egon has enough on his plate ;)

Support / Re: OpenGL changes in Android 4.2
« on: December 04, 2012, 12:17:10 pm »
Finally found the problem, I was loading the image pixels manually pixel by pixel and using a temporary buffer to hold the pixels. Even though I made sure I was freeing and nulling the buffer after each image load, I'm guessing Android was garbage collecting the buffer at some stage causing blank or disordered textures despite using allocateDirect to avoid the GC...

Anyway I use the GLUtil texImage2D now and all is fine. Seems like Google fiddled around with the GC again in 4.2 :p

Support / OpenGL changes in Android 4.2
« on: December 04, 2012, 12:57:50 am »
This is a general OpenGL question not directly related to jPCT but I would like to ask if anyone here is aware of any OpenGL ES1.x changes in Android 4.2 (JellyBean MR1)?

@Egon, did you need to make any modifications for Jellybean compatibility?

I have an app that uses pure OpenGL ES1.1 and the textures are all messed up on multiple 4.2 devices plus the emulator. If I load 5 textures, the last texture loaded is used for all 5 textures, but if I load only 2 textures, those 2 textures render fine. The texture clipping is also not working properly. The whole texture is rendered instead of the clipping region.

I create the textures by:

int[] textures = new int[5];
gl.glGenTextures(5, textures, 0);

Then load an image resource into a byteBuffer and upload it to the GPU:

gl.glBindTexture(GL11.GL_TEXTURE_2D, textures[n])
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, 512, 512,0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, byteBuffer) 


textureCrop0[0] = 0// Left
textureCrop0[1] = 0 // Bottom
textureCrop0[2] = 512// Width
textureCrop0[3] = 512 // Height
gl.glTexParameteriv(GL11.GL_TEXTURE_2D, GL11Ext.GL_TEXTURE_CROP_RECT_OES, textureCrop0, 0)

Were any of these functions changed in 4.2?

Support / Re: jpct-ae 64 bit
« on: November 14, 2012, 09:48:03 am »
This is still happening with the recent SDK rev. Quick fix:

Open your project branch and rename the folder lib to libs  (or vice versa), then go to the Project Properties -> Java Build Path, and update the jPCT jar disk location. Clean and build, problem solved.

Support / Re: Collision detection problem
« on: November 09, 2012, 02:34:40 am »
Not sure why all the objects are moving to 0,0,0 as a result of the collision, I'll use cubes instead and add some more debugging output to see what's going on.

Support / Re: Collision detection problem
« on: November 02, 2012, 03:24:36 pm »
The X and Z values returned have significant values from -9 to 9 which is odd since the object is not being moved at all in the x and Z axis. I assume the ellipsoid calculations are adding X and Z movement since ellipsoids are rounded despite the difference between the current translation and the new position being purely vertical on the Y axis?

If that's how it works then that's fine I can adjust the code to ignore X and Z values if need be.

Support / Re: Collision detection problem
« on: November 02, 2012, 03:01:18 pm »
New issue, the objects seem to center to 0,0,0 when I add the returned SV.

                float fTest = 25f;
      SimpleVector vcoll = null;
      //vcoll = obj3D.checkForCollisionSpherical(svPos, 5f);
      vcoll = obj3D.checkForCollisionEllipsoid(svPos, new SimpleVector(fTest,fTest,fTest), 1);
      // Was there a collision?
         svMomentum.y = -50;
         //svMomentum.y = -svMomentum.y;

The objects are simply moving vertically to a floor with no X and Z movement.. trying to figure out why the X and Z translation is centering to 0,0,0

Support / Re: Collision detection problem
« on: November 02, 2012, 02:51:45 pm »
Oh ok I'll adjust my code, thanks.

..update: works fine now.

Support / Re: Collision detection problem
« on: November 02, 2012, 02:42:04 pm »
Ok so the returned SV is the position in world space placing the object just before the point of collision. But for some reason it's placing the object ahead of the collision point within the collided object. Maybe it's my code.. I'll double check it.

ps. I was trying to get checkforcollisoinspherical working but had no luck hence why I posted here. Only 1 or 2 out of 50 sphere's were detecting collision despite various collideOffset values.

Support / Re: ArrayIndexOutOfBoundsException in World.renderScene()
« on: November 02, 2012, 01:23:13 pm »
Are you using multithreading separating the manipulation of 3D objects in one thread and having the render in another?

This has always been troublesome so if you are doing this, try doing everything in the rendering thread using a frame delta to calculate the correct movement of objects.

Support / Re: Collision detection problem
« on: November 02, 2012, 12:27:49 pm »
[edit] no worries I got collision working with the ellipse method rather than spherical...

But the returned SimpleVector is not returning the corrected point in space. The object is getting stuck below the floor for some reason. I'll keep on persisting.

Pages: 1 [2] 3 4 ... 16