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

Messages - paulscode

#1
Support / Countering visual y-offset from depth
April 11, 2013, 04:53:59 PM
I recall seeing a thread about this, but wasn't able to find it (and I apologize for using the wrong terminology).  I am looking for a way to counter the effect of the 2D y-position of an object changing the further away it is from the camera.  I drew up a simple diagram of where I'll be using this (this is an overhead view):



Note that this represents just one screen -- the full world will be longer, and the camera will move horizontally to follow the character.  The idea is to have a simulated 2D world with 3D characters and 2D billboarded objects in the background.  The visual y-offset with this setup causes the trees to float up off the ground the further away they are (which would be the desired behavior in a fully 3D world but not in a 2D world).  A couple of ways I could counter this:

- Apply a formula to modify an object's y position based on it's distance (I'm not sure what formula to use)

- Use reproject2D3DWS to calculate the furthest two corners of a "ground polygon", and snap the background objects to it

Any thoughts on the best route to go?
#2
Here are a couple more stack traces I got that were slightly different:

03-23 18:31:44.762: W/System.err(1291): java.lang.ArrayIndexOutOfBoundsException: length=11; index=12
03-23 18:31:44.762: W/System.err(1291): at com.threed.jpct.Vectors.addVertex(Vectors.java:85)
03-23 18:31:44.762: W/System.err(1291): at com.threed.jpct.Object3D.setBoundingBox(Object3D.java:2513)
03-23 18:31:44.762: W/System.err(1291): at com.threed.jpct.Object3D.calcBoundingBox(Object3D.java:1197)
03-23 18:31:44.762: W/System.err(1291): at com.threed.jpct.Object3D.rotateMesh(Object3D.java:2411)
03-23 18:31:44.762: W/System.err(1291): at raft.jumpy.view.Particle.<init>(Particle.java:66)
03-23 18:31:44.762: W/System.err(1291): at raft.jumpy.view.ParticleManager.<init>(ParticleManager.java:43)
03-23 18:31:44.762: W/System.err(1291): at raft.jumpy.view.GameView.<init>(GameView.java:111)
03-23 18:31:44.762: W/System.err(1291): at raft.jumpy.android.ouya.JumpyActivity$5.run(JumpyActivity.java:522)

(index was 12 instead of the typical 11, in case that's significant)

03-23 18:32:34.692: W/System.err(1291): java.lang.ArrayIndexOutOfBoundsException: length=11; index=11
03-23 18:32:34.692: W/System.err(1291): at com.threed.jpct.Mesh.rotateMesh(Mesh.java:682)
03-23 18:32:34.692: W/System.err(1291): at com.threed.jpct.Object3D.rotateMesh(Object3D.java:2406)
03-23 18:32:34.692: W/System.err(1291): at raft.jumpy.view.Particle.<init>(Particle.java:66)
03-23 18:32:34.692: W/System.err(1291): at raft.jumpy.view.ParticleManager.<init>(ParticleManager.java:43)
03-23 18:32:34.692: W/System.err(1291): at raft.jumpy.view.GameView.<init>(GameView.java:111)
03-23 18:32:34.702: W/System.err(1291): at raft.jumpy.android.ouya.JumpyActivity$5.run(JumpyActivity.java:522)
#3
Feedback / Re: Using jPCT-AE in my app training course
October 14, 2012, 07:58:48 PM
Yes, I wasn't sure how much enthusiasm it would generate, since there weren't any training course projects like it for comparison (and its my first kickstarter campaign). Its tracking about 50% of what I was shooting for.  I have a few more tricks up my sleeve to boost the support, but if it isn't successful I'll just break the project down into two smaller pieces: firstly an e-book project, to create the course book as an e-book (and a much smaller funding goal), then a second campaign a few months later for the remainder (tests, answer key, printing, etc).
#4
Feedback / Re: Using jPCT-AE in my app training course
October 14, 2012, 07:04:02 PM
I'm thinking of doing a 3D pacman-clone for this section.  The good thing about this idea is that it could be done in 2D in an earlier chapter, then the chapter on jPCT-AE can focus on using the engine without worrying about the backbone components of the game.
#5
Feedback / Using jPCT-AE in my app training course
October 11, 2012, 05:07:18 AM
Hello, everyone, I haven't posted on here in a while (been busy with my other projects).  My latest project is to create a training course on how to write Android apps. It will be a complete training course with a course book, exercises, quizzes, test booklet, and answer key, as well as a companion website and support forum. It will be geared toward anyone who is interested in learning how to write professional Android apps, whether they have prior programming experience or not.

Each new topic will first be related to real-world concepts, so they can be understood more easily. Then those concepts will be applied to create a practical, interesting demo app for each subject. By the end of the course, the student will have created several of these demo apps, that they can show off to their friends or potential employers.

What I want to do for the final chapter of the course book (the ultimate goal of the course, if you will), is to teach the student how to write a simple 3D demo game, using jPCT-AE.  With that in mind, does anyone have any suggestions on what that demo game should be, and any suggestions of important points to make for the student in this chapter?

I've also set up a kickstarter campaign to help fund the project, to cover the printing costs and compensate for the time I put into it.  Feel free to comment on there as well, if you have useful suggestions for the project.

(BTW, I don't mean this post to be a kickstarter ad -- I'll remove the above link if it is breaking the forum rules)
#6
Projects / Re: Simple Animated Texture Interface
February 19, 2012, 02:49:19 PM
No problem, sorry for the delay.  My main PC crashed yesterday (haven't determined the cause yet), so it might be a few days until I have everything back up and running to work on this.
#7
Projects / Re: Simple Animated Texture Interface
February 18, 2012, 03:21:28 AM
Haha, sorry got side-tracked.  I'll do this tomorrow :)
#8
Projects / Re: 3D Sound System
February 10, 2012, 10:31:28 PM
Quote from: Marlon on February 10, 2012, 01:35:49 PMI play sounds from the menu, but then I call quickPlay() without an Object3D.
You should be fine as long as sounds aren't queued to play after the call to cleanup.  I'm not sure what would be causing that crash.  I can't seem to replicate it on my computer.

Quote from: Marlon on February 10, 2012, 01:35:49 PMIs it possible to play mp3s as background music via your SoundSystem as well?
There is no mp3 codec plugin at the moment (must use the .ogg format instead)
#9
Projects / Re: 3D Sound System
February 10, 2012, 11:33:55 AM
Quote from: Marlon on February 09, 2012, 01:23:24 PMYes, your name is written and it should clean up successfully.
By the way... is it possible to deactivate any console output?
You can deactivate the console output by creating a minimal extension of the Logger class with all the printing methods overridden (take a look at the sourcecode to see which methods).  If cleanup is completed successfully, I'm not sure what would be causing that crash.  You aren't trying to play any other sounds (like in the menus or on exit)?
#10
Projects / Re: 3D Sound System
February 09, 2012, 05:08:52 AM
I haven't seen that error before.  Do you know if cleanup is able to successfully finish before that error appears? (it should print a short blurb into the console stating I am the author once cleanup is complete)
#11
Projects / Re: 3D Sound System
February 08, 2012, 12:36:01 AM
Oh, ok.  It is a problem with JavaSound then.  Oracle has royally screwed up JavaSound in recent versions by their decision to remove the "Java Sound Audio Engine" software mixer (requiring developers to choose one of the hardware mixers, which are all different with different capabilities for different sound cards).  I'm in the process of writing my own software mixer, but it will probably be some time before it is complete (I don't have much free time for programming any more, and what little I do have I am busy working on my N64 emulator project).  In the mean time, I would suggest using OpenAL, as it is more reliable (used to be JavaSound was more reliable, but not any more).

For the native OpenAL library, it ships with LWJGL (which I assume your application is using since you are writing it for jPCT, unless you are going with the software renderer)  It is included with all the other native libraries.
#12
Projects / Re: 3D Sound System
February 07, 2012, 10:27:58 PM
Quote from: Marlon on February 07, 2012, 09:05:03 PM
java.lang.NullPointerException
at paulscode.sound.SoundSystemJPCT.tick(SoundSystemJPCT.java:270)
at graphic.Graphic3DController.update(Graphic3DController.java:708)
Aha, I can see that if it is hitting the exception at the beginning of the loop, then the subsequent source positions wouldn't get updated.  This most likely is the cause for your sounds not panning.  I'll see if I can verify that this is what's happening, and fix the problem if it is.  I'm not sure why the null pointer exception is happening in the first place, though.  This used to happen when using quickPlay, because I wasn't making sure when a temporary source is destroyed, that it gets removed from any objects it is bound to.  I thought I had fixed this problem, but I'll take another look at the code to see if I missed something.  Could be a thread synchronization problem.


Quote from: Marlon on February 07, 2012, 09:05:03 PMAnd at the beginning there is this exception:

Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
Error in class 'LibraryLWJGLOpenAL'
    Unable to initialize OpenAL.  Probable cause: OpenAL not supported.
    ERROR MESSAGE:
        Could not locate OpenAL library.
    STACK TRACE:
        org.lwjgl.openal.AL.create(AL.java:151)
        org.lwjgl.openal.AL.create(AL.java:102)
        org.lwjgl.openal.AL.create(AL.java:201)
        paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164)
        paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576)
        paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572)
        paulscode.sound.CommandThread.run(CommandThread.java:121)
    ERROR MESSAGE:
        Could not locate OpenAL library.

Starting up SoundSystemJPCT...
Switching to Java Sound
    (The Java Sound API.  For more information, see http://java.sun.com/products/java-media/sound/)
JavaSound initialized.

Do you get that same exception with the applet?  Make sure the OpenAL native library is on your system somewhere.


Quote from: Marlon on February 07, 2012, 09:05:03 PMI am initializing this way:

public void initSoundSystem() {
        try
        {
            // add some plug-ins:
            SoundSystemConfig.addLibrary( LibraryLWJGLOpenAL.class );
            SoundSystemConfig.addLibrary( LibraryJavaSound.class );
            SoundSystemConfig.setCodec( "wav", CodecWav.class );
        }
        catch( SoundSystemException e )
        {}
soundSystem=new SoundSystemJPCT();
SoundSystemConfig.setSoundFilesPackage("");
}
With SoundSystemJPCT you do not need the calls to addLibrary and setCodec (these are done automatically in the background when you instantiate the SoundSystemJPCT object -- those calls are only a requirement for the core SoundSystem library).  That being said, even though calling these again is redundant, it shouldn't have any negative effects.

Since your problem is happening in JavaSound, I re-uploaded that test applet using JavaSound instead of OpenAL, just to make sure the problem isn't there.  The above link is the same.
#13
Projects / Re: 3D Sound System
February 07, 2012, 01:48:52 AM
Ok, I rigged up one of my old applets.  Let me know if you hear/ don't hear the panning between left/ right speakers as the camera rotates in place:

Panning Test Applet
#14
Projects / Re: 3D Sound System
February 07, 2012, 12:37:34 AM
Hmm.. it seems to pan ok on my computer.  Let me write a quick test applet for you to run, to rule out a hardware-related issue.
#15
Projects / Re: 3D Sound System
February 07, 2012, 12:27:31 AM
By default, it should use ATTENUATION_ROLLOFF, so if you aren't changing it that shouldn't be the problem.  I downloaded your file and will do some tests.  I'll let you know what I find.