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

Pages: 1 [2] 3 4 ... 48
Support / Re: Advices about possible project
« on: February 12, 2014, 01:47:04 am »
Is ti posible to generate a poligon by having the corners of that poligon and use it as a plane to apply a texture over it?

I mean, lets imagine I have this set of coordinates:

(20, 50)
(25, 36)
(15, 85)
(12, 65)
(65, 5)
etc etc etc

How can I draw a poligon model that uses all that points????

Support / Advices about possible project
« on: February 05, 2014, 11:42:27 pm »
Hi Guys, I have been out of JPCT for years, now I was asked to do a software (Maybe for android but could be done in java too) that requires image processing, so Immediately I came here to ask.

One of the app requirements are:

 - Take a pic with an android device, then you could select the floor or even a wall and change it texture, all this from an android device, any image post processing  could be done on a server if necessary.

How do you think this could be achieved? ANy advices will be very appreciated. Becausse I must give an answer soon.

Support / Re: How to create a simple skybox horizon?
« on: September 16, 2009, 04:37:29 pm »
Well, having another word just for rendering the horizon would work. you just have to call the rendering methods to have the framebuffer filled with that information, and then render the other world without clearing the framebuffer.

You can also have a cube with a texture like the horizon, and a secundary camera inside that cube, render that secundary camera into the frameBuffer and then render your game without clearing the framebuffer.

Support / Re: texture problem
« on: April 30, 2009, 05:41:33 pm »
I guess is due to the name of the texture file

12 chars

3DS files stores texture names in 8.3 format

inside the map, the referenced texture name is but the file is Nonebrown.jpg

Projects / Re: SS3D
« on: April 08, 2009, 05:03:17 pm »
Well, is not the big deal, but anyway, here are some pics, the whole app is at 75% I guess.

--> used my son teeth as a texture  ;D

News / Re: Compatibility test for compiled Object3Ds
« on: March 30, 2009, 07:40:13 pm »
It ran at 13 fps on my centrino 1.6, 1GB ram, ATI X600, Windows XP - jre1.6.0_12

Support / Re: Performance problems
« on: March 30, 2009, 04:11:59 pm »
Hi, I tested it on my laptop using firefox and IE and jre1.6.0_12. I runned it from another 2 machines and the GLCanvas doesnt appeared. Thats strange..... I put an IPaintListener on the FrameBuffer and put some outputs, on the machines that the glcanvas is visible the outputis being printed but ont eh other machines where the GLCanvas is not visible the output is not being printed. Something have to be buggy with it. Now I am using the software renderer which is more stable but is not as fast as I wish it were.

Support / Re: Performance problems
« on: March 29, 2009, 12:13:19 am »
Hi, some news on the topic....

I made a copy of my applet and changed the exteds JApplet for JFrame and it runs great.... and it also ran well when chenged to sw rendering. I have not changed the Rendering Thread/EventManagmentThread just changed the JApplet for JFrame.

Should this be reported as a bug???? Only happens on Applets with GLCanvas.

Support / Re: Performance problems
« on: March 28, 2009, 11:55:54 pm »
I changed it to render in software instead of inside a GLCanvas (minor change) and the delay does not appear. COuld this be some issue the the new lwjgl with glCanvas????

Support / Re: Performance problems
« on: March 28, 2009, 09:58:28 pm »
Paul, the problem is not abouth that beucasse I was happening before adding that piece of code of the listener. Egon or Paul....Do you have a machine with Tomcat and mysql to send a test case??

Support / Re: Performance problems
« on: March 28, 2009, 08:59:44 pm »
The outputs are also being stopped for that period of time.

Support / Performance problems
« on: March 28, 2009, 03:57:55 pm »
Hi, ai am having problems with performance, from time to time (almost each 10 seconds) the CPU usage goes to 100% on the applet and then it stops responfing for 5 or 6 seconds, and then continues on the same way. Any ideas????

I am using a Centrino 1.6, 1Gb RAM, ATIX600, and I am running a GL Canvas inside an applet.

The code is quite simple, The class that does all the Rendering is:

Code: [Select]

 * Created on 1 de noviembre de 2005, 22:32

package visor;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.StringTokenizer;

import javax.swing.ImageIcon;

import com.threed.jpct.Camera;
import com.threed.jpct.FrameBuffer;
import com.threed.jpct.IRenderer;
import com.threed.jpct.Interact2D;
import com.threed.jpct.Loader;
import com.threed.jpct.Matrix;
import com.threed.jpct.Object3D;
import com.threed.jpct.SimpleVector;
import com.threed.jpct.Texture;
import com.threed.jpct.TextureInfo;
import com.threed.jpct.TextureManager;
import com.threed.jpct.World;
import com.threed.jpct.util.KeyMapper;
import com.threed.jpct.util.KeyState;
 * @author  Gold Oozaru
 * @version
public class RenderThread extends Thread implements MouseListener{
    static boolean OGL;

    World mundo;
    FrameBuffer buffer;
    KeyMapper mapaTeclas;
    KeyState estadoTeclas;
    TextureManager manejadorTexturas;
    Texture texturaActual;
    boolean izquierda;
    boolean derecha;
    boolean adelante;
    boolean atras;
    boolean luces;
    boolean salir;
    ArrayList paredes;
    ArrayList techos;
    ArrayList pisos;
    Object3D vidrios;
    Object3D otros;
    Object3D inicio;
    Canvas canvas;
    URL docBase;
    public Graphics g;
    String url="";
    String mapa="";
    Object3D seleccionado=null;
    /** Creates new RenderThread */
    public RenderThread(World am, FrameBuffer ab, KeyMapper ak, Canvas ac, String nombreMapa, String aurl) {
    //---------------------Hacer el renderThread
        texturas ();
        //texturasList ();
        pisos=new ArrayList ();
        techos=new ArrayList ();
        paredes=new ArrayList ();
        vidrios=new Object3D (0);
        otros=new Object3D (0);
        inicio=new Object3D (0);
        cargar ("mapa.3DS", 0.3f);
        mundo.addObject (otros);
        mundo.addObject (vidrios);
        addObjects (pisos, mundo);
        addObjects (techos, mundo);
        addObjects (paredes, mundo);
        mundo.buildAllObjects ();
        //System.out.println ("getposition ()"+mundo.getCamera().getPosition ());
    public void addObjects (ArrayList objetos, World mundo) {
    for (int i=0;i<objetos.size();i++) {
    Object3D temp=(Object3D) objetos.get(i);
    mundo.addObject (temp);
    public void cargar (String fileName, float escala) {
try {
URL link=new URL (url+"/mapas/");
System.out.println ("url: "+link.getFile());
        Object3D partes []=Loader.load3DS (link, mapa, escala);
        for (int i=0;i<partes.length;i++) {
            Object3D part=partes [i];
            part.setRotationMatrix(new Matrix());
            if ((i&1)==1) part.setTransparency(0);
            String p1="";
            String p2="";
            String p3="";
            StringTokenizer separador=new StringTokenizer (part.getName(), "_");
            try {
            } catch (Exception E) {
            if (part.getName ().startsWith ("vidrio") || part.getName ().startsWith ("vidrio") || part.getName ().startsWith ("parabrisa")) {
                vidrios=Object3D.mergeObjects (vidrios, part);
            } else if (p2.startsWith ("P")) {
            Object3D temp=new Object3D (0);
            part=Object3D.mergeObjects (part, temp);
            } else if (p2.startsWith ("T")) {
            } else if (p2.startsWith ("W")) {
            Object3D temp=new Object3D (0);
            part=Object3D.mergeObjects (part, temp);
            System.out.println ("pared agregada: "+part.getName());
            } else if (part.getName ().startsWith ("inicio")) {
            inicio=Object3D.mergeObjects (inicio, part);
            } else {
                otros=Object3D.mergeObjects (otros, part);
} catch (Exception E) {
    public void run () {
        while (!salir) {

            if (OGL){

            buffer.clear ();
            buffer.update ();
            mundo.renderScene (buffer);
            mundo.draw (buffer);
            buffer.displayGLOnly ();

            canvas.repaint ();
            try {
            } catch (Exception E) {
                this.stop ();
            do {
                if (estadoTeclas!=KeyState.NONE) {
                    obtenerEventos (estadoTeclas);
            } while (estadoTeclas!=KeyState.NONE);
            hacerMovimientos ();
        this.stop ();
    public void hacerMovimientos () {
        if (izquierda) {
            moverIzquierda ();
        if (derecha) {
            moverDerecha ();
        if (atras) {
            Camera c=mundo.getCamera ();
            c.moveCamera (Camera.CAMERA_MOVEOUT, 6f);
        if (adelante) {
            Camera c=mundo.getCamera ();
            c.moveCamera (Camera.CAMERA_MOVEIN, 6f);
    public void obtenerEventos (KeyState evento) {
        boolean estado=evento.getState ();
        if (estadoTeclas.getKeyCode ()==KeyEvent.VK_UP)
        if (estadoTeclas.getKeyCode ()==KeyEvent.VK_DOWN)
        if (estadoTeclas.getKeyCode ()==KeyEvent.VK_LEFT)
        if (estadoTeclas.getKeyCode ()==KeyEvent.VK_RIGHT)
        if (estadoTeclas.getKeyCode ()==KeyEvent.VK_ESCAPE)
        if (estadoTeclas.getKeyCode ()==KeyEvent.VK_SPACE)

    public String getPath () {
        System.out.println (this.getClass ().getResource (""));
        return (this.getClass ().getResource ("./").getFile().replace ("%20", " "));
    public String getURLPath (String filename) {
        return (this.getClass ().getResource (filename).getFile());   
    public void texturas () {
    manejadorTexturas=TextureManager.getInstance ();
    ArrayList materiales=texturasList ();
    URL link=null;
try {
link = new URL (url+"/images/Texturas/");
} catch (Exception e) {
    for (int i=0;i<materiales.size();i++) {
    manejadorTexturas.addTexture (((String)materiales.get(i))+".JPG", new Texture (link, ((String)materiales.get(i))+".JPG"));
    public ArrayList texturasList () {
    try {
URL link=new URL (url+"/images/Texturas/props.txt");
URLConnection uc=link.openConnection();
DataInputStream dis=new DataInputStream (uc.getInputStream());

    System.out.println ("TEXTURAS: ");
    String texturas=dis.readLine();
StringTokenizer separadorMaterial=new StringTokenizer (texturas, "|");

ArrayList materiales=new ArrayList ();

while (separadorMaterial.hasMoreTokens()) {
String material=separadorMaterial.nextToken();
StringTokenizer separadorTextura=new StringTokenizer (material, ":");
return materiales;

} catch (Exception e) {
return null;
    public void cambiarTextura (String parte) {
    public void moverIzquierda () {
        Camera temp=mundo.getCamera ();
        temp.rotateY (0.02f);
    public void moverDerecha () {
    Camera temp=mundo.getCamera ();
         temp.rotateY (-0.02f);
    public void renderAWT (Graphics g) {

        buffer.clear ();
        buffer.update ();
        mundo.renderScene (buffer);
        mundo.draw (buffer);
        try {
        } catch (Exception E) {
            this.stop ();

    public void enviarComentario (String mensaje, ImageIcon imagen) {

public void mouseClicked(MouseEvent e) {

public void mouseEntered(MouseEvent e) {

public void mouseExited(MouseEvent e) {

public void mousePressed(MouseEvent e) {

public void mouseReleased(MouseEvent evt) {

if (seleccionado!=null)seleccionado.setAdditionalColor(;

int x=evt.getX();
    int y=evt.getY();
    SimpleVector ray=Interact2D.reproject2D3D(mundo.getCamera(), buffer, x, y);
    int poli[]=Interact2D.pickPolygon(mundo.getVisibilityList(), ray);
    Object3D temp=mundo.getObject(Interact2D.getObjectID(poli));

Projects / Re: SS3D
« on: March 25, 2009, 03:41:12 pm »
Hi, I am back again after several months...  ;D Anyway the web part is finished and now I am implementing the 3d part with jpct. I will post some pics sooner.

Support / CHanging the memory usage by default?
« on: February 19, 2009, 05:36:26 pm »
Hi, I am having problems with running an app in java. I know I could use the -Xmx and -Xms params when calling to java.exe.

But I need to do something different, I need to chance the default memory usage rules for java. That means, that all the java apps will run with that memory specifications without needing to specify it for every program.

Is there any way to do it?

Projects / Re: Flier Match
« on: February 02, 2009, 04:44:28 pm »
mm well, the project is dead actually. I dont eve remember the state of the project, I have not seen it in more than 4 months. Maybe I could retake it later.

Pages: 1 [2] 3 4 ... 48