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

#41
Support / animation problem
February 21, 2008, 06:03:18 PM
I've just used a walk and stand animaton with sub sequences up till now and everything was working fine.  However I set up a jump, where the characters size is quite a bit different.  He's scrunched down now getting ready to leap.  Jpct makes garbage out of the model.  If I set the default model that loads at the start as the jump model, then it looks all right, but the stand and walk animations turn into garbage.

edit:  I might get that worked out by using more gradual changes, I'm not sure.  But I'm also getting an error for too many key frames defined when I get to the sixth one with this code:

    Mouse = loadModel("data/stand.3ds",1); 
// Object3D Mouse;
Mouse.translate(0, -5, 0);
// Mouse.createTriangleStrips();
TextureManager tm = TextureManager.getInstance();
    Texture tex=new Texture("data/fur.jpg");
    tm.addTexture("fur", tex);    
    tex = new Texture("data/red.jpg"); 
    tm.addTexture("red", tex);    
    Mouse.setTexture("fur");
world.addObject(Mouse);
Animation mouse = new Animation(5);
mouse.createSubSequence("walk");

mouse.addKeyFrame(loadModel("data/walk2.3ds",1).getMesh());
mouse.addKeyFrame(loadModel("data/walk3.3ds",1).getMesh());
mouse.addKeyFrame(loadModel("data/walk4.3ds",1).getMesh());
mouse.addKeyFrame(loadModel("data/walk1.3ds",1).getMesh());
mouse.createSubSequence("stand");
mouse.addKeyFrame(loadModel("data/jump.3ds",1).getMesh());
mouse.addKeyFrame(loadModel("data/jump2.3ds",1).getMesh());


The last key frame gives me that error.  Doesn't seem like very many.  I was planning on using quite a few more animations.
OH  DUH!!!  I forgot I defined the animation size.  I'll get back on if the more gradual animations helped.
#42
Support / key released
February 21, 2008, 02:53:13 AM
I'm trying to figure out how to get a key released event.  I'm using code from the helloworld

   private void keyAffected(KeyState state) {
      int code=state.getKeyCode();
      boolean event=state.getState();
      switch (code) {

         case (KeyEvent.VK_LEFT): {
            left=event;
            break;
         }
         case (KeyEvent.VK_RIGHT): {
            right=event;
            break;
         }
         case (KeyEvent.VK_DOWN):{
        downPressed = event;
         }

      }
   }


A key released is false, but that's sort of a do nothing state also.
#43
Support / Collision not working
February 20, 2008, 06:13:02 AM
I tried doing a search for collision and came up with this function for the mouse:
private void doGravity()
{
      SimpleVector msPos=Mouse.getTransformedCenter();
      msPos.add(msHgt);
      if(world.checkCollision(msPos, dr, .6f)== Object3D.NO_OBJECT)
      {
    Mouse.translate(gravity); 
      }           
}
private void move()
{
SimpleVector a = Mouse.getZAxis();
a.scalarMul(-.15f);
a = Mouse.checkForCollisionEllipsoid(a, elipse, 2);
Mouse.translate(a);
}


The gravity part works, but the mouse walks through as in this picture:


The elipse is (2,5,2)  The five is the mouse height and works for gravity.

The platform is set for collision with this code:
    platform.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
    platform.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);


I tried setting collision for the mouse but it didn't help.  I had to use -.15 in the scalermult or else the mouse went backwards.
#44
Support / Cloned object
February 19, 2008, 06:44:47 AM
I thought about using cloned platforms in this game to save file size, etc.  I'm wondering how this will affect performance, or what would be the best way to get good performance from a lot of cloned platforms and walls rather than a larger structure like the castle that is octree.  What do you recommend for that?
#45
Support / applet site
February 18, 2008, 05:13:20 AM
Out of curiosity mostly, what type of site would I need to host a game applet?  I have a phone modem so a home server is out.
#46
Projects / Labyrinth Z
February 15, 2008, 06:03:43 PM
I realize I'm just starting with jpct and it's a bit early, but I have to work on a project to keep my interest up.  So, my project is a platform/puzzle game called Labyrinth Z.  It stars a humanized mouse and will involve getting jumps right through timing and moving a lot of levers and switches for elevators and anything else I come up with as I go along.


#47
Support / animation
February 15, 2008, 09:15:52 AM
I'm just starting to look at animation.  I did a search and tried the two possibilities in Blender.  The md2 looks to be hopeless.  So I'll need to load 3ds key frames.  From what I read you load them and add them to the animation.  The part I don't quite understand is how you assign it time wise.  For instance, if I do a walk animation I might have a key at 1,5,10,15 or something.  In this case, it's evenly spaced, but other animations don't have evenly spaced key frames so how do I assign times to the key frames?
#48
Support / polling problems
February 14, 2008, 02:31:28 AM
I can't seem to get keyboard polling working in the hello world program.  I copied the poll and keyaffected functions from the fps and have some variables.  I don't get errors on the program, but when I try to run it with the polling I get these errors:

Exception in thread "main" java.lang.NullPointerException
   at HelloWorldAWTGL.poll(HelloWorldAWTGL.java:92)
   at HelloWorldAWTGL.loop(HelloWorldAWTGL.java:56)
   at HelloWorldAWTGL.main(HelloWorldAWTGL.java:24)

OK I think it was null because I didn't include these lines:
       frame.addWindowListener(new WindowEvents());
       keyMapper=new KeyMapper(frame);   

but now I get an error on the WindowEvents() function saying it can't resolve it, so apparently I'm not importing something.
#49
Support / lwjgl
February 14, 2008, 01:07:50 AM
Little question on LWJGL from a java noob.  If lwjgl were on the classpath of my java runtime of my system, and I clicked on a game written with jpct and run from the web start, would it use the LWJGL on my system and have a faster load time?  This probably means nothing to anyone but a phone modem user.
#50
Support / 2nd object
February 11, 2008, 07:10:38 AM
I'm starting with the cartoon network code for a framework because it's small and a little easier to understand and I'm rusty with my Java.  Anyway, I have an object loaded from this code:


Object3D[] obj= Loader.load3DS("Shadow.3DS", 1);


    Object3D Toy=new Object3D(0);
     
     
      for (int i=0; i<obj.length; i++) {
         Object3D part=obj[i];

         part.setCenter(SimpleVector.ORIGIN);
         part.rotateX((float)-Math.PI);
         part.rotateMesh();
         part.setRotationMatrix(new Matrix());
       
        Toy=Object3D.mergeObjects(Toy, part);
      }
         
         
Toy.translate(0, 0, 0);


What I don't quite understand is it starts out with this Object3d array named obj, loads the model, and doesn't mention it again until it's rotating some parts.  What I'd like to know is how would I load the next object and would that rotation code that  sets it aright with the world work for the second object also, or is that just parts of one object and it has to be redone?

So, this code was made for some kind of cartoon effect, but I want to modify it so it just loads multiple objects and sets them right side up.
#51
Support / bump mapping
February 09, 2008, 08:10:25 AM
Hi.  I'm just starting to look at jPct and really like it so far.  About the only complaint I have is that it doesn't appear to do bump mapping with Opengl.  Are there any plans for that?