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

Pages: 1 2 3 [4] 5 6 ... 58
46
Projects / Re: Archar
« on: June 04, 2011, 02:49:47 am »
Not yet, I've been a bit obsessed with another project I'm working on (a Nintendo 64 emulator for Android).  I tend to cycle through my projects as I get burned out on them so I'll eventually get back around to this one.

47
Bones / Re: Bones - Skeletal and Pose animations for jPCT
« on: April 19, 2011, 11:50:17 am »
if you have access to an ubuntu machine, you can get latest converter from here:
https://launchpad.net/~ogre-team/+archive/ogre

Another option if you can't get the Windows version to work, might be to install the free program VirtualBox, and then create an Ubuntu virtual machine to use for compiling and converting.  Sort of a round-about way to do things, but its another option that won't cost anything if all else fails.

48
Projects / Re: 3D Sound System
« on: April 05, 2011, 12:26:23 pm »
??  Absolute path implies that it is not in the jar, doesn't it?  If there is some reason you can't/won't compile your resource files in the jar, then why not use one of the methods that take an InputStream argument to load your files?  Also, there's no problem running from within Netbeans.

49
Projects / Re: 3D Sound System
« on: April 02, 2011, 01:15:58 am »
the file/path is correct
...
Code: [Select]
Error in class 'LibraryLWJGLOpenAL'
    Unable to open file 'C:\Users\Disastorm\Documents\NetBeansProjects\ProjectDerby\scraping-ice-1.wav'
...

well...

If you are sure the path and file names are correct, the next thing to check is if you compiled the file into the JAR

50
Projects / Re: 3D Sound System
« on: March 27, 2011, 11:42:22 am »
Hello what does this mean?
...
    Unable to open file 'sound/fx/scraping-ice-1.wav' in method 'loadSound'
...
    Unable to open file 'scraping-ice-1.wav' in method 'loadSound'

This means it was unable to open the file.  Most likely cause is the name of the file or the folder path are misspelled.  Note that it is case sensitive (i.e. "sound" vs. "Sound"), and be sure to check if there is a missing "s" (i.e. "sound" vs. "sounds").

If you are sure the path and file names are correct, the next thing to check is if you compiled the file into the JAR (passing a name like "sound/fx/whatever.wav" will look inside the JAR for the file, not in the external containing folder).

If neither of those are the problem, please post your initialization code (any SoundSystemConfig settings and plug-ins), or the HTML file you are using for the loader.

51
Support / Re: array of SimpleVectors
« on: March 07, 2011, 04:14:58 am »
Yeh, try changing that last line to:
Code: [Select]
positions[positionsnumb] = new SimpleVector(x, y, z);

52
Support / Re: Polygon picking?
« on: February 17, 2011, 08:29:40 pm »
I'm not sure the procedure you used to create your terrain, so this might not apply, but in my RobotBuilder project, I have the terrain built as a tiled grid with a height for each vertice.  I can accurately know the height at a given 2D coordinate on the map by interpolating between the two horizontal and two vertical vertices, as long as the remaining "catty-corner" vertice isn't completely different than the other three (which I've made sure of when I originally created the terrain).  I can provide some example code if that is hard to visualize from my description.

53
Support / Re: Polygon picking?
« on: February 16, 2011, 12:55:48 am »
it can be seen as a direction vector too, because the camera in camera space is always located at (0,0,0).
Doh!  Talk about being redundant.  I always seem to come up with overly-complicated ways to do something simple..

So taking that into account and considering the new method you mentioned, the procedure becomes much simpler:

1) Use Interact2D.reproject2D3DWS and SimpleVector.normalize to convert 2D click coordinates into a direction vector in world space.
2) Use World.calcMinDistance to obtain the distance to the "click point".
3) Use SimpleVector.add to obtain the 3D coordinates of the "click point".

Using my earlier example, the code would look something like this:

Code: [Select]
        // Get the mouse's coordinates on the applet window:
        int x = e.getX();
        int y = e.getY();
       
        // Convert that into a direction vector in world space:
        SimpleVector direction = new SimpleVector( Interact2D.reproject2D3DWS(
                                                       camera, buffer, x, y ) ).normalize();

        // Calculate the distance to whatever was clicked on:
        float distance = world.calcMinDistance( camera.getPosition(), direction, 10000 );
       
        // Check if we clicked on something:
        if( distance == Object3D.COLLISION_NONE )
        {
            // Nope, didn't click on anything.
        }
        else
        {
            // Calculate the exact 3D coordinates for the point that was clicked:
            SimpleVector collisionPoint = new SimpleVector( direction );
            collisionPoint.scalarMul( distance );
            collisionPoint.add( camera.getPosition() );
        }

54
Support / Re: Polygon picking?
« on: February 15, 2011, 10:46:03 pm »
The method I've always used to determine the "click point" works like this (I've not done this in an Android project, but the concept should be the same):

1) Use Interact2D.reproject2D3D to convert 2D click coordinates into 3D camera space
2) Use SimpleVector.matMul and SimpleVector.add to converted that to world space
3) Use SimpleVector.calcSub and SimpleVector.normalize to calculate the direction vector
4) Use World.calcMinDistance to obtain the distance
5) Use SimpleVector.add to obtain the 3D coordinates of the "click point".

So in an applet, I've used this procedure as follows:
Code: [Select]
        // Get the mouse's coordinates on the applet window:
        int x = e.getX();
        int y = e.getY();
       
        // Get the 3D coordinates in Camera space:
        SimpleVector position = new SimpleVector( Interact2D.reproject2D3D(
                                                       camera, buffer, x, y ) );
        // Convert the coordinates to World space:
        position.matMul( camera.getBack().invert3x3() );
        position.add( camera.getPosition() );
       
        // Determine the direction from the camera position to the click point:
        SimpleVector direction = position.calcSub( camera.getPosition() ).normalize();
       
        // Calculate the distance to whatever was clicked on:
        float distance = world.calcMinDistance( position, direction, 10000 );
       
        // Check if we clicked on something:
        if( distance == Object3D.COLLISION_NONE )
        {
            // Nope, didn't click on anything.
        }
        else
        {
            // Calculate the exact 3D coordinates for the point that was clicked:
            SimpleVector collisionPoint = new SimpleVector( direction );
            collisionPoint.scalarMul( distance );
            collisionPoint.add( position );
        }

55
Projects / Re: 3D Sound System
« on: February 11, 2011, 11:06:34 pm »
After figuring out that i now have to add libraries and codecs (haven't updated the SoundSystem for ages...), sound is back again... ;D
Yes, the library has started becoming a bit bloated I think (although considerably more compatible than it was before).  I've stopped adding new features, and just plan to make bug-fixes and optimizations when needed.  I do have a new update I should get out at some point, though, which reduces the delay that used to happen when transitioning between music streams.  I'll try and get the code cleaned up and post it this weekend.

BTW, I am working on an Android version which utilizes a native mixer I wrote (requires the NDK of course).  The API is virtually the same, so it should make porting desktop jPCT games to Android a bit easier from an audio standpoint.  I haven't had a lot of time for programming lately, but hopefully I'll be able to get it out in the coming weeks.

56
Support / Re: What is the best method to modify images with code.
« on: February 06, 2011, 07:47:58 pm »
In case anyone else doesn't have a nice test case for you, here are some of the methods that you will be looking at (I just threw this together from the sourcecode for my Animated GIFs project, so it isn't really a complete working example):

Code: [Select]
import android.graphics.Bitmap;

Bitmap image = Bitmap.createBitmap( textureWidth, textureHeight, Bitmap.Config.ARGB_4444 );
int[] pixels = new int[image.getWidth() * image.getHeight()];

// Of course you can draw whatever you like into the pixels array.  Some other useful things:

// To copy the contents of the pixels array onto the Bitmap:
image.setPixels( pixels, 0, image.getWidth(), 0, 0, image.getWidth(), image.getHeight() );

// If you want to clear the bitmap:
if( useAlpha )
    image.eraseColor( Color.TRANSPARENT );
else
    image.eraseColor( Color.BLACK );

// Or if you have a "background" image that you always want to start with:
background.getPixels( pixels, 0, background.getWidth(), 0, 0,
    background.getWidth(), background.getHeight() );
image.setPixels( pixels, 0, background.getWidth(), 0, 0,
    background.getWidth(), background.getHeight() );

// To create a new Texture from the Bitmap:
Texture newTexture = new Texture( image, useAlpha );

// Then to replace an existing texture with the new one you created:
TextureManager.getInstance().replaceTexture( textureID, newTexture );

57
Support / Re: What is the best method to modify images with code.
« on: February 06, 2011, 02:49:58 pm »
Wondering if any way you can access a texture via its int[] or byte[]
 array.
ITextureEffect will work for this, by implementing the apply(int[] dest, int[] source) method.  One of the projects I'm working on now does something similar, where I'm rendering a separate 3D scene (via the software renderer) onto an Image, and then using PixelGrabber in an ITextureEffect, I paint it onto a texture, creating a "game within a game".

58
Support / Re: Transparent background for HelloWorld demo
« on: January 10, 2011, 12:24:47 am »
This sounds similar to what dl.zerocool was doing on this thread.  Specifically, this may be related to your problem:
Quote
I create a new camera and I give a render to my glSurfaceView
and of course set the Translucent window  (8888) pixel format and depth buffer to it.
(Without that your glSurfaceView will not support alpha channel and you will not see the camera layer.)

I've not done anything like this myself, so I don't know if this is helpful or not.

59
Support / Re: Anybody willing to do a small test?
« on: January 05, 2011, 02:32:36 am »
Droid X, Android 2.2 results:

Double dragon: 15.97 fps
Flower power: 20.42 fps
Ninjas' garden: 11.39 fps
Emperor's new clothes: 43.72 fps
Magic island: 17.38 fps
TOTAL SCORE: 18853

60
Support / Comic book appearance
« on: January 04, 2011, 05:15:18 pm »
I am thinking about making some children's educational games, and one effect I'd like to achieve is for each frame to look like a 2D drawing in a comic or colloring book.  I've been playing around with various settings and textures, and so far I get the closest to my goal if I use only ambient lighting and texture a black "outline" on the edge of each component (for example around the waist and ankles of a pair of pants).  The main problem is somehow drawing an outline around the visible edges of each object.  I'm thinking I could duplicate each object and texture one completely black and scale it up a tad, then use a pseudo-billboarding effect to always have it behind to other object.  I thought I'd see if anyone here has some additional ideas I could try to improve the effect I'm after.

Pages: 1 2 3 [4] 5 6 ... 58