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

#61
Support / lwjgl 2.4.2 fails on linux
June 23, 2010, 10:17:39 PM
hi,

hello world GL example in latest release (1.21) doesn't launch. it throws the exception below. it runs ok in previous versions including 1.21 alpha. i guess this is related to LWJGL 2.4.2

QuoteException in thread "main" java.lang.ExceptionInInitializerError
   at com.threed.jpct.GLHelper.findMode(Unknown Source)
   at com.threed.jpct.GLHelper.findMode(Unknown Source)
   at com.threed.jpct.GLHelper.init(Unknown Source)
   at com.threed.jpct.GLRenderer.init(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at HelloWorldOGL.loop(HelloWorldOGL.java:37)
   at HelloWorldOGL.main(HelloWorldOGL.java:15)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
   at org.lwjgl.opengl.XRandR$Screen.<init>(XRandR.java:234)
   at org.lwjgl.opengl.XRandR$Screen.<init>(XRandR.java:196)
   at org.lwjgl.opengl.XRandR.populate(XRandR.java:87)
   at org.lwjgl.opengl.XRandR.access$100(XRandR.java:52)
   at org.lwjgl.opengl.XRandR$1.run(XRandR.java:110)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.opengl.XRandR.getConfiguration(XRandR.java:108)
   at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:618)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   ... 9 more
#62
Support / onSurfaceCreated(..)
March 31, 2010, 09:57:05 PM
hi,

javadocs state that, when GL surface is lost, all OpenGL resources -such as textures- are also lost. does this mean Object3D's are also lost and need to be loaded/created again ? or is it
enough to reload textures and set them on objects ?

thanks
#63
Support / FrameBuffer.dispose()
March 31, 2010, 09:39:56 PM
does FrameBuffer.dispose() disposes textures somehow ?

i'm playing with orientation change event with G1. on such a case, only Renderer.onSurfaceChanged(..) is called. after old frameBuffer is disposed all my -blitted- textures seem to be gone. i tried adding them to TextureManager but didnt help ???
#64
Support / blitting text and images
March 30, 2010, 04:02:41 PM
here are Android versions of two small and (hopefully) handy classes for blitting text and images. more information can be found on original thread

TexturePack packs several arbitrary sized images into a jPCT texture. it automatically layouts images and adjusts Texture size.

AGLFont creates GL renderable (blittable) fonts out of Android fonts.

Rectangle is used by AGLFont.

Bones Android demo app demonstrates how to use it

and an addition to GLFont by nmare which allows multi-line and multi-color text blits

cheers ;D
r a f t

edit: updated the links and fixed getStringBounds(..) issue
edit2: added link to nmare's addition
#65
Feedback / unlimited detail in 3d
March 19, 2010, 04:05:02 PM
#66
Support / rotation by matrix
March 12, 2010, 08:03:57 AM
i have a rotation matrix multiplied by a uniform scale matrix.

* SimpleVector.rotate(matrix) also applies scaling to vector, is this intentional ?
* how can i check rotation part (upper 3x3) of matrix has no scale information ?
* how can i clear scaling from matrix ? assuming i dont know scaling value

thanks
#67
Support / OpenGL ES 2.0 support (including shaders)
March 09, 2010, 04:50:17 AM
dont get too excited, only possible via JNI ;D

QuoteOpenGL ES 2.0 support

Applications targeting Android 2.0 (API level 5) or higher can now directly access OpenGL ES 2.0 features. This brings the ability to control graphics rendering through vertex and fragment shader programs, using the GLSL shading language.

A new trivial sample, named "hello-gl2", demonstrates how to render a simple triangle using both shader types.

here is the blog entry. one good thing about new NDK is, it states OpenGL ES 1.1 and 2.0 API's (headers) are stabilized and are guaranteed to be supported in all later releases

unfortunately emulator doesnt support OpenGL ES 2.0  ::)

there is a demo app in NDK, OpenGL ES version of San Angeles Observation. readme says it contains more than 60.000 faces and it runs ~5 fps on emulator, quite impressive. but it does all rendering in native code
#68
Support / Matrix serialVersionUID
March 05, 2010, 06:47:10 PM
i've noticed serialVersionUID of Matrix is changed in desktop version and that is also different from AE version. is this really necessary ? looking inside with javap, it seems data structure is not changed. all three (1.20, 1.21.alpha, AE) has same structure:

    float[][] mat;
    float[] mat0;
    float[] mat1;
    float[] mat2;
    float[] mat3;


so i suppose they can share same serialVersionUID, unless of course contents of these arrays hasn't changed ?
#69
Support / DeSerializer
March 05, 2010, 06:20:51 AM
how does DeSerializer work exactly ? plain java serialization or other format ? i've found java serialization is god damn slow on this thing :-\
#70
Support / NPE at Object3D.animate(..)
March 04, 2010, 10:38:22 PM
java.lang.NullPointerException
   at com.threed.jpct.Animation.interpolateLinear(Unknown Source) (Animation.java:343 in first release)
   at com.threed.jpct.Animation.doAnimation(Unknown Source)
   at com.threed.jpct.Object3D.animate(Unknown Source)
        ..

my first experession is not that bad. karga boy (810 poly) renders 30+ fps in emulator without animation and background. your demo app run ~10 fps. however debugging kills performace, loading time increases and fps drops down to 8-10. i also get out of memory time to time while restarting the application. log says it cant find memory for bitmap

btw, my friend told eclipse can debug app in phone which sounds good..
#71
Support / setting IVertexController
March 03, 2010, 06:39:20 AM
is it expensive to set an IVertexController ?

say i have two IVertexController's to operate on same mesh, does it make sense to set each one again each frame ? if they create an array of vectors and copy mesh vertices into it each time they are set, this is definetely expensive and shouldnt be done
#72
Support / class loading
February 04, 2010, 08:35:07 PM
i've faced something very strange: many of Bones classes has constructors or methods taking Ardor classes as parameters. as they hold no fields to Ardor classes, they are expected to be loaded and run without ardor. for all but one this is the case. that single one even cannot be loaded by classloader because of a thrown ClassNotFoundException for an ardor interface. the unfound interface even is not imported  ???

i've further digged the situation and tried to isolate the problem by commenting out some code.

that class passes some of ardor classes to some static helper methods in another class. static method takes ardor interface as parameter. if i change the method to take implementation class instead of interface as parameter, the problem vanishes.. very odd thing, never faced before  ???
#73
Support / Logger level
February 04, 2010, 03:37:02 PM
is it possible to expose log level of Logger ? so i can print some verbose information in Bones if log level matches..
#74
Support / quaternions and matrices
February 03, 2010, 08:29:46 AM
for 2 rotations R1 and R2, let Q1 and Q2 quaternion representations and M1 and M2 matrix representations of these rotations. M1 and M2 are row major matrices like jPCT's

does Q1xQ2 represent the same rotation with M1xM2 ?
#75
any idea why this happens ?

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 8
at com.threed.jpct.GenericVertexController.updateMesh(Unknown Source)
at com.threed.jpct.Mesh.applyVertexController(Unknown Source)
..
#76
Bones / Bones - Skeletal and Pose animations for jPCT
January 06, 2010, 11:45:01 PM
Bones is a animation API for jPCT. It supports skeletal and pose animations. It's aimed to be small library with no additional dependencies where possible.

Bones can be found at its home page. The download pack contains the source code, necessary libraries, Eclipse project files and a few demo applications. It's definitely free software with a "Do whatever with it" license.

Note: As the API evolved, following information is not exactly correct anymore. Please refer to Bone's home page for up to date information.



Bones initially loads skinning information via Ardor3D's Collada loader. Out of this information, a series of SkinnedObject3D's are constructed. They have mesh data, textures coordinates and skinning information. It's enough to set their textures and call build() to prepare them to be added into a jPCT world.

After this initial loading, they can be saved in a compact form. Saved objects can be later reloaded with loader, with no dependencies to Ardor3D

At the moment, the project is at "Proof of Concept" state. Skinning and mesh deformation works, but skeleton poses can only be created programmatically. Hence it's not really useful for games at the moment. This is so since, Ardor3D's loader only support this much at the moment. As they progress, Bones will progress..

Cheers ;D
r a f t

Edit: Updated the link with some code cleanup and documentation.
Edit2: Updated title and description to reflect changes in the API
#77
Support / steps to take after Object3D.setMesh(mesh)
January 06, 2010, 08:35:30 PM
hi,

i created an Object3D with zero triangles and set a mesh to it. after this either calling build() or recreateTextureCoords() throws a null pointer exception at recreateTextureCoords().

what other steps should i take to prepare the object ?
#78
Support / safely interpolate rotations
January 04, 2010, 11:45:39 PM
hi,

Ardor uses quaternions for rotations. in demo, it calculates a rotation from a vector to a vector and interpolates rotation with identity rotation. AFAIK with quaternions this is perfectly legal and make sense.

i tried to emulate this in jPCT by interpolating two matrices. sometimes results become very strange. i guess this happens when two rotations (matrices) are too different. afterall interpolating matrices for rotations does not makes sense mathematically.

so is there a safe way in jPCT to interpolate a rotation ?

r a f t
#79
Support / translation
January 03, 2010, 03:00:59 PM
hi,

i've figured that, translation info in Object3D's rotation matrix effects where the object is rendered.

for example, this box is rendered at 1,0,0 point
Object3D box = Primitives.getBox(1, 1);
box.getRotationMatrix().set(3, 0, 1f);


is this intentional ?
#80
hi,

how can i create a rotation matrix such that, when applied, it rotates a direction vector to another ?

formally:
SimpleVector from;
Simplevector to;

from.matMul(m);
from.equals(to); // -> should be true ignoring rounding errors