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 - .jayderyu

Pages: 1 ... 6 7 [8]
106
Support / Re: Ongoing Support for jPCT?
« on: November 21, 2008, 05:55:09 pm »
Does your engine have physics? I noticed the Bullet demo, but couldn't find information on whether or not the physics are built into your engine.

I spent some time trying to understand how JBullet works. Let's just say the samples with JBullet are more complex than they need to be to have it working. This maybe some form issue with it working with LWJGL.

The physics engine doesn't need graphical output. It's not bound together. Which is nice, really. What you will need to do is
verify that your RigidBody(jbullet) and you Object3d:model(jpct) are matched in size and orientation.
Then on your update after you have taken a update/step in jbullet.
get the bodies that were updated, then update the Object3D corrospondegly.



107
Support / Re: LWJGL applet loader Texture problem
« on: November 21, 2008, 05:33:01 pm »
thank you :)

108
Support / Re: LWJGL applet loader Texture problem
« on: November 18, 2008, 09:13:43 am »
hey thanks that helps. though when I tried using a plane the plane didn't show. might have to do with the angle though. thank you

umm where is createTextureCoords. I can't find them under Texture, TextureManager or Object3D. Anyother places?

109
Support / Re: LWJGL applet loader Texture problem
« on: November 17, 2008, 03:25:24 am »
Thanks for you responce and research. ouch. Is this something new to JPCT newer version. I remember using an older version where I could texture an sphere, but non of my cubes have worked at all.

110
Support / LWJGL applet loader Texture problem
« on: November 17, 2008, 12:49:21 am »
Ok problem with textures. I'm using LWJGL Applet loader to get the hardware acceleration. Ok that works. The problem i'm having is with textures. They don't display.

Heres an object

http://sre.hopto.org/images/badtexture.jpg

Heres the texture

http://sre.hopto.org/images/expo_stones.png

Heres the relevent texture code
Code: [Select]
  public void init(){
    world = new World();
    World.setDefaultThread( Thread.currentThread() );

    // your pick, same result
    //TextureManager.getInstance().addTexture("stone", new Texture(getResource("expo_stones.png")));
    //TextureManager.getInstance().addTexture("stone", new Texture(getDocumentBase(),"expo_stones.png"));
   
    camera = world.getCamera();
    camera.setPosition(80f,-50f,0f);
    camera.lookAt(new SimpleVector(0,0,0)); // this is invalid. this should always look at player. modify soon
   
    world.getLights().setOverbrightLighting ( Lights.OVERBRIGHT_LIGHTING_DISABLED );
    world.setAmbientLight( 50, 50, 50 );
    world.addLight( new SimpleVector( 50, -50, 30 ), 120, 120, 120 );

    Object3D object;
    object = Primitives.getBox(50f, 0.01f);
    object.setTexture("stone");
    object.setEnvmapped(Object3D.ENVMAP_ENABLED);
    object.build();
    world.addObject(object);

    buffer = new FrameBuffer( width, height, FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY );
    buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
    canvas = buffer.enableGLCanvasRenderer();
    add( canvas, BorderLayout.CENTER);
    canvas.setVisible( true );
    world.buildAllObjects();
    camera = world.getCamera();
    new Thread(this).start();
  }

  private InputStream getResource( String resourceName ){
    return getClass().getClassLoader().getResourceAsStream( resourceName );
  }

the texture is at the root of the .jar file.

111
Support / Re: Swing/JApplet problem, no panel - (solved)
« on: July 22, 2008, 04:19:17 pm »
solved, thanks. I tried a few things to get it to paint rather than draw :|.


Code: [Select]
  public void paint(Graphics g){
      input.update();

      buffer.clear(Color.blue);   // erase the previous frame
      // render the world onto the buffer:
      world.renderScene( buffer );
      world.draw( buffer );
      buffer.update();
      buffer.displayGLOnly();
      canvas.repaint();
      [b]getContentPane().paintAll(g);[/b]
}

112
Support / Swing/JApplet problem, no panel
« on: July 22, 2008, 05:03:51 am »
blarg

Well got another problem  ::)

My Swing JPanel does not display in the contentPane of the applet.



Code: [Select]

in
init(){
    createGuiEdit();
 
    canvas = buffer.enableGLCanvasRenderer();
    getContentPane().add(canvas, BorderLayout.WEST);
    //add( canvas, BorderLayout.CENTER);
    canvas.setVisible( true );
    canvas.addMouseListener( input );
    canvas.addMouseMotionListener( input );
}


private void createGuiEdit(){
    JButton button;
    panel = new JPanel(new BorderLayout());
   
    button = new JButton("1x1");
    button.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){input.newBox(e); } });
    button.setVisible(true);
    panel.add(button);
   
    panel.setVisible(true);
    getContentPane().add(panel, BorderLayout.EAST);
}


  public void paint(Graphics g){
      input.update();

      buffer.clear(Color.blue);   // erase the previous frame
      // render the world onto the buffer:
      world.renderScene( buffer );
      world.draw( buffer );
      buffer.update();
      buffer.displayGLOnly();
      canvas.repaint();    // Paint the canvas onto the applet (hardware mode)
}

do I need to draw the JPanel?

113
Support / Re: Applet black screen
« on: July 09, 2008, 05:09:41 pm »
I've put the texture in the jar file. That's where l get the IO File permission problem. I was reading up on Pauls jPCT Gears demo and there is use of a using more of a complex command for loading resources as a Input Stream. Not sure if that's normal for Applet's at all. I'm switching over from a jME webstart to jPCT Applet. I'm not familiar with Applets as much, but my project concept leans towards Applets better.

As a side note. I switched over from jME because after all the .jars and jni I would need required roughly 10mb. Where as jPCT is going to clock in at about 2mb. I just prefer my quick online game designs to be smaller. Awesome engine btw. I really like it.

114
Support / Re: Applet black screen
« on: July 08, 2008, 06:51:46 pm »
Thank you, thank you. I tend sometimes miss the obvious when I've been dealing with problems to long. The suggestions helped
me locate what was going on :)

I'm having IO Permission errors when trying to load textures. Not sure why that's coming up. I will need to fix that too.
Any ideas what might cause that.

115
Support / Applet black screen
« on: July 08, 2008, 05:32:55 pm »
sigh....

I've been banging my head over this a good portion last night. I've tried scouring through the support section. I've seen some information but they don't seem to work. I'm missing something obvious I'm sure. I've reduced my work to use Pauls jPCTGears demo as the basics. Can anyone point out whats wrong.

this program runs through applet loader and is in hardware.

Code: [Select]
import java.applet.*;
import javax.swing.JApplet;
import java.awt.*;

import com.threed.jpct.*;

public class Editor extends Applet implements Runnable{
  private boolean exit = false;

  private World world;
  private FrameBuffer buffer;
  private Camera camera = null;
  private int width = 640;
  private int height = 480;
  private boolean loop=true;

  Canvas canvas;
  private EditorInput input;

  public void init(){
   
    world = new World();
    World.setDefaultThread( Thread.currentThread() );
   
    world.setAmbientLight(50, 250, 50);
    world.getLights().setOverbrightLighting (Lights.OVERBRIGHT_LIGHTING_DISABLED );
    world.getLights().setRGBScale( Lights.RGB_SCALE_2X );

    world.setAmbientLight( 150, 150, 150 ); // just trying to get anything besides black screen

    // Create a main light-source:
    world.addLight( new SimpleVector( 50, -50, 300 ), 20, 20, 20 );   
   
    // prepare buffer
    buffer = new FrameBuffer( width, height, FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY );
    buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);

    // prepare canvas
    canvas = buffer.enableGLCanvasRenderer();
    add( canvas, BorderLayout.CENTER);
    canvas.setVisible( true );
    //canvas.addMouseListener( input );
    //canvas.addMouseMotionListener( input );
   
    TextureManager.getInstance().addTexture("box", new Texture("box.jpg"));
    //test object
    Object3D box = Primitives.getBox(3f, 2f);
    box.setTexture("box");
    box.setEnvmapped(Object3D.ENVMAP_ENABLED);
    box.build();
    world.addObject(box);
    world.buildAllObjects();

    Camera camera = world.getCamera();
    camera.setPosition(10f,10f,10f);
    camera.lookAt(new SimpleVector(0,0,0)); // look at center of world. assuming box defaults to 0.0.0
   
    new Thread(this).start();
   
  }
 
 
  public void run() {
    while (loop) {
      this.repaint();
      try {
          Thread.sleep(10);
      } catch(Exception e) {
          //Don't care...
      }
    }
   
  }
 
  public void paint(Graphics g){
      buffer.clear();   // erase the previous frame
      world.renderScene( buffer );
      world.draw( buffer );
      buffer.update();
      buffer.displayGLOnly();
      canvas.repaint();    // Paint the canvas onto the applet (hardware mode)
  }

    @Override
    public void destroy()
    {
    loop=false;
    }
}

yeah this code doesn't work. The TaskManager also doesn't report much activity from Firefox or Java. Which leaves me to believe
that no real repainting is being done.

116
Feedback / Re: How to use ogl on an applet
« on: July 08, 2008, 08:19:37 am »
This is mostly to Paul or anyone who knows how to do ogl in an applet with the appletLoader.

I'm stumped. I use the appletLoader and I get a Fatal Error(7). I tried looking for in on the LWJGL, but am can't seem to find it. Since There is some one here who knows what they are doing in getting JPCT and JWGL working with an applet. How does it work?

Pages: 1 ... 6 7 [8]