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

Topics - kkl

#41
Hi,

Does anyone have the strange looking preference activity in android before? The fonts in preference activity becomes square after some settings have been made there.

Step to reproduce:
1. Load texture and add objects to world
2. In preference activity, if the feature is unchecked by user, unload texture immediately and remove objects from world.
3. Go back to livewallpaper preview.
4. Goto the preference activity again. It shows square font (font is in english, no other language), and no errors from JPCT-AE log.

However, if I don't unload the texture and only remove objects from world, it doesn't cause the error.

[attachment deleted by admin]
#42
Support / Black texture loading .3ds model
May 05, 2013, 05:25:05 PM
Hi Egon,

When I tried to load 3ds model into jpct-ae, it showed the 3D object with black texture. Did I miss something? I did exactly like in JPCT wiki tutorial. I'm using Blender 2.66a to export the 3ds. If I call calcTextureWrapSpherical(), the texture shows. Unfortunately, I want it to follow the texture mapping in 3ds instead of jpct texture wrapping.

Code:

//onSurfaceChanged
try {
Object3D obj = load3DSModel(context.getAssets().open("monkey.3ds"), 20);
obj.setName("monkey");
obj.build();
world.addObject(obj);
} catch (IOException e) {
Log.e("kkl", "Error reading 3ds", e);
}

private Object3D load3DSModel(InputStream is, float scale) {
Object3D[] model = Loader.load3DS(is, scale);
Object3D o3d = new Object3D(0);
Object3D temp = null;
for (int i = 0; i < model.length; i++) {
temp = model[i];
temp.setCenter(SimpleVector.ORIGIN);
temp.rotateX((float) (-.5 * Math.PI));
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
o3d = Object3D.mergeObjects(o3d, temp);
o3d.build();
}
return o3d;
}


Log:

05-05 23:23:04.348: I/jPCT-AE(15498): Loading file from InputStream
05-05 23:23:04.348: I/jPCT-AE(15498): Expanding buffers...16384 bytes
05-05 23:23:04.348: I/jPCT-AE(15498): File from InputStream loaded...16026 bytes
05-05 23:23:04.348: I/jPCT-AE(15498): Processing new material leafmat!
05-05 23:23:04.353: I/jPCT-AE(15498): Processing object from 3DS-file: Suzanne
05-05 23:23:04.418: I/jPCT-AE(15498): Object 'Suzanne_jPCT0' created using 968 polygons and 505 vertices.
05-05 23:23:04.468: I/jPCT-AE(15498): Normal vectors calculated in 37ms!
05-05 23:23:04.468: I/jPCT-AE(15498): Memory usage before compacting: 19105 KB used out of 19783 KB. Max. memory available to the VM is 49152 KB.
05-05 23:23:04.683: I/jPCT-AE(15498): Memory usage after compacting: 14468 KB used out of 19783 KB. Max. memory available to the VM is 49152 KB.
05-05 23:23:04.763: I/jPCT-AE(15498): Subobject of object 2/monkey compiled to indexed fixed point data using 2904/505 vertices in 55ms!
05-05 23:23:04.763: I/jPCT-AE(15498): Object 2/monkey compiled to 0 subobjects in 77ms!

#43
Support / Error in live wallpaper
April 29, 2013, 06:27:12 PM
Hi Egon, I got strange error after I viewed my live wallpaper in live wallpaper settings. It seems like some objects are bound statically. After disposing frame and world (after quiting the settings), the running live wallpaper received an error like the following.


04-30 00:07:20.167: E/AndroidRuntime(13968): FATAL EXCEPTION: GLThread 31292
04-30 00:07:20.167: E/AndroidRuntime(13968): java.lang.NullPointerException
04-30 00:07:20.167: E/AndroidRuntime(13968): at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2169)
04-30 00:07:20.167: E/AndroidRuntime(13968): at com.threed.jpct.World.draw(World.java:1348)
04-30 00:07:20.167: E/AndroidRuntime(13968): at com.threed.jpct.World.draw(World.java:1089)
04-30 00:07:20.167: E/AndroidRuntime(13968): at com.kision.firefliesforest.MainRenderer.draw(MainRenderer.java:130)
04-30 00:07:20.167: E/AndroidRuntime(13968): at com.kision.firefliesforest.BasicRenderer.onDrawFrame(BasicRenderer.java:104)
04-30 00:07:20.167: E/AndroidRuntime(13968): at net.rbgrn.android.glwallpaperservice.GLThread.guardedRun(GLWallpaperService.java:669)
04-30 00:07:20.167: E/AndroidRuntime(13968): at net.rbgrn.android.glwallpaperservice.GLThread.run(GLWallpaperService.java:534)


Steps to reproduce:
1. Set my live wallpaper to phone.
2. Goto Live Wallpaper settings (the place where you select your live wallpaper), view the preview of my live wallpaper.
3. Quit the preview and then Live Wallpaper settings.
4. When screen goes back to home screen, the running live wallpaper in phone receives error.

Is it a bug or I did it wrong? Are JPCT objects created and disposed statically? 
#44
Support / Emissive light
April 23, 2013, 10:45:41 AM
Hi Egon,

Does JPCT have emissive light? as in light inside object, like this one; the last column of the spheres http://www.glprogramming.com/red/images/spheres.gif
#45
Support / FrameBuffer resize
February 05, 2013, 04:48:18 PM
Hi I'm trying to resize the framebuffer from (800, 600) to (360, 600), but any object located outside of (360, 600) bound is clipped. Is it possible to resize the framebuffer while objects are still displayed beyond the resized bound?
#46
Support / Draw line
February 05, 2013, 10:18:39 AM
I tried to use Polyline in jpct for java, but the class is not found. Is it available in jpct-java? I found it in jpct-java doc and jpct-ae though.
#47
Support / Multiple screen size issue
January 29, 2013, 04:28:04 PM
Hi I tried to put 3D object in a fixed location (say the bottom of the screen), but the object's location appears to be different in different devices which has different screen size and density. I tried using reproject2D3D or reproject2D3DWS to put objects in place, but no luck for that. I guess you are using perspective view instead of frustum. Is there any way to sort it out?
#48
Support / Texture issue
January 14, 2013, 04:53:17 PM
Hi I have a texture issue... It somewhat shows the border of the image while the actual one doesn't have it... Hope you guys could help me out..




[attachment deleted by admin]
#49
Support / Scaling issue
January 09, 2013, 04:14:45 PM
Hi, I wanted to scale object in custom factor x and factor y, but I found only scale(float factor) which I think it is scaling factor x and y equally. Is there any simply function to do factor x and y scaling? or I have to do it from ground up by multiplying the matrix?
#50
Support / Interact2D issue after camera transformation
December 29, 2012, 08:30:23 AM
Hi I'm working on object following finger touch by Interact2D in android. The reproject2D3D gave unexpected value after I translated the camera. I know the reproject2D3D doesn't take account of camera transformation. Is there any way to get correct location after camera transformation?

Here's the code

Happens when finger touching:

public void onTouch(MotionEvent e) {
Camera cam = world.getCamera();
SimpleVector rayTemp = Interact2D.reproject2D3D(cam, frame, (int)e.getX(), (int)e.getY(), 50f);
rayTemp.z = 0;
plane.setOrigin(rayTemp);
}


Move the camera along X axis:

Camera cam = renderer.getWorld().getCamera();
cam.moveCamera(cam.getXAxis(), 1);


Creating objects and world:

frame = new FrameBuffer(gl, width, height);
world = new World();
world.setAmbientLight(10, 10, 10);

sun = new Light(world);
sun.setIntensity(255, 255, 255);

Texture texture = new Texture(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.test3)), true);
TextureManager.getInstance().addTexture("texture", texture);
texture.setClamping(true);

plane = Primitives.getPlane(20, 2);
//cube.calcTextureWrapSpherical();
plane.setTexture("texture");
plane.setTransparency(0);
plane.build();

world.addObject(plane);

Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(plane.getTransformedCenter());
#51
Support / Blending issue
December 25, 2012, 03:43:39 PM
Hi I'm new to opengl and JCPT android. I tried putting in a texture with tranparency, and it shows up in an unexpected way. Did I miss anything? Could anyone show me the proper way to do it?


The code is as followed:



Config.glTransparencyMul = 1f;
Config.glTransparencyOffset = 1f;

frame = new FrameBuffer(gl, width, height);
world = new World();
world.setAmbientLight(20, 20, 20);


sun = new Light(world);
sun.setIntensity(250, 250, 250);
// Create a texture out of the icon...:-)
Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(context.getResources().getDrawable(R.drawable.ic_launcher)), 64, 64));
TextureManager.getInstance().addTexture("texture", texture);
texture.setClamping(true);


plane = Primitives.getPlane(3, 10);
// cube.calcTextureWrapSpherical();
plane.setTexture("texture");
plane.setTransparency(0);
plane.strip();
plane.build();


Thanks for help ;)

[attachment deleted by admin]