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

#11776
Support / Some .3DS Files are not shown
September 13, 2005, 07:14:51 AM
I've moved this thread to support...anyway: The loader loads polygonal objects only (this is stated somewhere...if not in the javadocs, it may be in the "manual"). That is why straight lines don't show for example. There is simply no matching primitive in jPCT to show them. I don't know about the bevel as i don't know how this works in 3DS Max and what the exporter does with it.
You may want to try to export the model into another format (good old ASC for example, which most likely doesn't support bevel so that it has to be converted to a polygonal representation), reimport it into Max and save it as a 3DS again. Maybe that helps.

BTW: If you are still using the version from Feb. 2004, you should really upgrade. It may not fix the 3DS problem, but it fixes a lot of other stuff...
#11777
Support / Videos
September 11, 2005, 11:36:31 PM
#11778
Support / Getting an object from a World
September 11, 2005, 02:31:02 AM
It was just an example. tempObject3D.setName(nombresMapas ); is better?
#11779
Support / Getting an object from a World
September 11, 2005, 02:06:23 AM
Quote from: "Melssj5"
Any idea about how to solve my problem?

tempObject3D.setName("Seleccionador.3DS");   :?:
#11780
Support / Getting an object from a World
September 10, 2005, 01:03:35 PM
If you want to do it that way, you have to set the name yourself by using setName(<String>) for the objects in question, i.e. after loading your object, call obj.setName("Seleccionador"); before adding it to the world. But you have to make sure that the name is unique for the world the object belongs too. jPCT doesn't check this.
In Paradroidz, i'm using a subclass of World called Level that holds references to XXXManagers, which are in fact object pools. I.e. an EnemyManager manages all the enemies, an ExplosionManager manages all the explosion...that way, it's always possible to access your objects without retrieving them back from the world. But that's totally up to you, it's just one way of doing it that i wanted to share...it doesn't have to be the best one.
#11781
Support / Videos
September 10, 2005, 12:54:49 PM
Have a look at the Java Media Framework (jmf). But as far as i've heard, it's quite complicated to use and doesn't work too well. But it's the only possibility that i know of. I've never used it myself.
#11782
Support / Re: I did it
September 06, 2005, 10:49:26 AM
Quote from: "Melssj5"A suggestion is to do a method that only checks for a collision, it may be useful.
It is there. checkCollisionEllipsoid does exactly that. Again, the fps example should help to clarify this.
#11783
Support / Using the mouse when using OpenGL
September 06, 2005, 10:47:07 AM
Mouse is provided by LWJGL. It is "automagically" associated with the OpenGL frame. You simply create the OpenGL frame, then the Mouse and it should work fine.
#11784
Support / Whats wrong with my collision detection
September 06, 2005, 10:39:20 AM
Sorry for confusing you with the methods' naming.  In earlier versions, naming was different (something like moveCameraCollision IIRC, which was bogus too). But i agree that the naming is not that good. I just couldn't come up with anything better at that time and now...now i'll leave it this way... :wink:
#11785
Bugs / 3ds models and mirrored objects
September 06, 2005, 12:58:50 AM
Have you found a solution? This mirroring seems to be a *strange* feature. I've downloaded the 3ds you are using in your applets from your site and loaded it into DeepExploration (a mighty viewer/converter for all kinds of 3d and 2d files) and while it manages to mirror the parts in question, it "inverts" them, so that the back faces are visible while the front faces are not. So it's also wrong...just different...
#11786
Support / Detecting OpneGL capability
September 05, 2005, 06:14:23 PM
To detect if OpenGL is possible, you may get the video modes by calling
FrameBuffer.getVideoModes(IRenderer.RENDERER_OPENGL);
If it returns a none empty array, OpenGL is supported. But that doesn't mean that your SIS651 correctly supports it. SIS is known for crappy drivers and the SIS651 is a joke of a graphics chipset. I also think some people reported problems with SIS and LWJGL but i'm not sure...
#11787
Support / Using the mouse when using OpenGL
September 05, 2005, 06:08:07 PM
Here it is. It may contain some Paradroidz specific stuff, but it should help to get you started.

package naroth.util;

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;

import org.lwjgl.input.*;
import com.threed.jpct.*;

import naroth.config.*;

public class MouseMapper extends MouseMotionAdapter implements MouseListener {

  public final static int BUTTON1=0;
  public final static int BUTTON2=1;

  private boolean lwjgl;
  private Frame frame=null;
  private java.awt.Cursor oldCursor=null;
  Robot robot=null;
  private int mouseX=0;
  private int mouseY=0;
  private boolean button1=false;
  private boolean button2=false;
  private boolean button3=false;
  private boolean hidden=false;


  public MouseMapper() {
     init(null);
  }

  public MouseMapper(Frame comp) {
     try {
        robot=new Robot();
     } catch (Exception e) {
         Logger.log("Error initializing awt.Robot: "+e.getMessage(), Logger.ERROR);
     }
     init(comp);
  }

  public void mouseMoved(MouseEvent e) {
    mouseX=e.getX()-frame.getInsets().left;
    mouseY=e.getY()-frame.getInsets().top;
  }

  public void mouseDragged(MouseEvent e) {
     mouseX=e.getX()-frame.getInsets().left;
     mouseY=e.getY()-frame.getInsets().top;
  }

  public void mouseClicked(MouseEvent e) {}

  public void mousePressed(MouseEvent e) {
     if (e.getButton()==MouseEvent.BUTTON1) {
        button1=true;
     }
     if (e.getButton()==MouseEvent.BUTTON2) {
        button2=true;
     }
     if (e.getButton()==MouseEvent.BUTTON3) {
        button3=true;
     }
  }

  public void mouseReleased(MouseEvent e) {
    if (e.getButton()==MouseEvent.BUTTON1) {
       button1=false;
    }
    if (e.getButton()==MouseEvent.BUTTON2) {
       button2=false;
    }
    if (e.getButton()==MouseEvent.BUTTON3) {
      button3=false;
   }

 }

 public void mouseEntered(MouseEvent e) {}

 public void mouseExited(MouseEvent e) {}



  public void center() {
     if (frame!=null) {
        int x=frame.getX();
        int y=frame.getY();
        int width=frame.getWidth();
        int height=frame.getHeight();
        width=width>>1;
        height=height>>1;
        x+=width;
        y+=height;
        robot.mouseMove(x,y);
     } else {
        // Tu nix...dies ist schon automatisch durch das Mouse.setGrabbed() erledigt.
     }
  }

  public void hide() {
    if (frame!=null) {
       oldCursor=frame.getCursor();
       int[] pixels=new int[16*16];
       Image image=Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(16, 16, pixels, 0, 16));
       java.awt.Cursor transparentCursor=Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0, 0),"hidden");
       frame.setCursor(transparentCursor);
     } else {
        Mouse.setGrabbed(true);
     }
     hidden=true;
  }

  public void show() {
     if (frame!=null) {
        if (oldCursor!=null) {
           frame.setCursor(oldCursor);
           oldCursor=null;
        }
     } else {
        Mouse.setGrabbed(false);
     }
     hidden=false;
  }

  public boolean isVisible() {
     return !hidden;
  }

  public void destroy() {
     if (frame!=null) {
        frame.removeMouseMotionListener(this);
        frame.removeMouseListener(this);
     } else {
        if (Mouse.isCreated()) {
           Mouse.destroy();
        }
     }
     show();
  }

  public boolean buttonDown(int button) {
     if (!lwjgl) {
        if (button==BUTTON1) return button1;
        if (button==BUTTON2) return button2|button3;
     }
     return Mouse.isButtonDown(button);
  }

  public int getMouseX() {
     if (!lwjgl) {
        return mouseX;
     } else {
        return Mouse.getX();
     }
  }

  public int getMouseY() {
     if (!lwjgl) {
        return mouseY;
     } else {
        return Configuration.height-Mouse.getY();
     }
  }

  public int getDeltaX() {
     if (!lwjgl) {
        int mouseXCenter=(frame.getWidth()>>1)-frame.getInsets().left; // Korrektur, da mouseMoved und mouseDragged dies auch abziehen
        return mouseX-mouseXCenter;
     } else {
        if (Mouse.isGrabbed()) {
           return Mouse.getDX();
        } else {
           return 0;
        }
     }
  }

  public int getDeltaY() {
     if (!lwjgl) {
        int mouseYCenter=(frame.getHeight()>>1)-frame.getInsets().top; // Korrektur, da mouseMoved und mouseDragged dies auch abziehen
        return mouseY-mouseYCenter;
     } else {
        if (Mouse.isGrabbed()) {
           return Mouse.getDY();
        } else {
           return 0;
        }
     }
  }

  private void init(Frame comp) {
     if (comp!=null) {
        this.frame=comp;
        comp.addMouseMotionListener(this);
        comp.addMouseListener(this);
        lwjgl=false;
        center();
     } else {
        lwjgl=true;
        try {
           if (!Mouse.isCreated()) {
              Mouse.create();
           }
        } catch (Exception e) {
           //e.printStackTrace();
           Logger.log("Couldn't create LWJGL-mouse - initialize the OpenGL renderer first!", Logger.WARNING);
        }
     }
  }
}
#11788
Support / FeatureRequest: getLighting()
September 05, 2005, 06:05:31 PM
I agree. I'll add it.
#11789
Bugs / 3ds models and mirrored objects
September 04, 2005, 12:46:37 PM
I wrote the importer based on a free, reverse engineered documentation from the net. I don't own 3ds, so i can't really verify this. It seems like 3ds doesn't really copy the geometry but stores the former (unmirrored one) with an additional mirror plane or matrix or whatever...i have no clue. Does it help to export the object into another format and reimport it as 3ds in 3ds?
#11790
Support / Whats wrong with my collision detection
September 04, 2005, 12:42:23 PM
Don't use checkCameraCollision()...it's ancient stuff that doesn't work well in all cases. I strongly suggest to use checkCameraCollisionEllipsoid instead. Have a look at the fps example to see how to.