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

Pages: [1]
1
Support / Re: How to blit components in 3D app based on jPCT
« on: April 14, 2010, 09:03:13 am »
swing-gl is not a completed project. for example keyboard events are not dispatched so it's normal that JTextArea doesn't work.

you may want to have a look at PureSwing. it's a mature project but a bit big in size and requires a fairly decent video card

Hi,raft,

I have in trouble and need your help

If i write my keyboard events,how could I do ,give tips please

2
Support / Re: How to blit components in 3D app based on jPCT
« on: April 14, 2010, 08:41:34 am »
thanks

give me some time  ;D

3
Support / Re: How to blit components in 3D app based on jPCT
« on: April 13, 2010, 06:44:26 am »
Looks fine to me at first glance. I can't remember exactly if it has to be added to the frame or the canvas...you are doing both. Maybe doing just one of them will make it work?

hi,
i did as you said,but keylisten still not work... :'(

now i am seeking other way...

i used the project powered by raft http://www.jpct.net/forum2/index.php/topic,1338.0.html,everything is run well,but JScrollPanel and JTextArea can't work
i don't konw what's wrong,so give it up

now,i find a GUI API (FengGUI),i will do some test with it later,could you give me more info about it,or other gui project like FengGui :P

this thread will update,if something run, i will let you know first ;D

4
Support / Re: How to blit components in 3D app based on jPCT
« on: April 07, 2010, 11:23:06 am »
Well, you can't render Swing or AWT components on top of a native OpenGL output. You can try to use FrameBuffer.enableGLCanvasRenderer() (don't forget to disable the software renderer in addition), which will return a Canvas. This (heavyweight) Canvas can be combined with Swing/AWT components to a degree. You should find some information about this when searching the forums.

well,as you say ,I get a AWTGLCanvas which i can put this canvas into a JFrame,but the KeyMapper is wrong, i implements a KeyListener(java.awt.event.KeyListener;),but it seemes not work

my code such as
public class Test implements KeyListener {
        frame = new JFrame("test");
        panel = new JPanel();
        frame.setLayout(new GridLayout(1,1));
   frame.setSize(width, height);
   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   frame.add(panel);
        frame.setVisible(true);
   buffer = new FrameBuffer(panel.getWidth(),panel.getHeight(),FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY);
   buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
   //buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
   canvas = buffer.enableGLCanvasRenderer();
   panel.add(canvas,new GridLayout(1,1));
   canvas.addKeyListener(this);
   frame.addKeyListener(this);
}

public void keyTyped(KeyEvent e){
   System.out.println("ley d");
}
public void keyPressed(KeyEvent e){
   System.out.println("ley d");
}
public void keyReleased(KeyEvent e){
   System.out.println("ley d");
}

the game loop is
buffer.clear();
theWorld.renderScene(buffer);
theWorld.draw(buffer);
buffer.update();
buffer.displayGLOnly();
canvas.repaint();

Is there something I can change to allow the mapper to be correctly ?

5
Support / Re: How to blit components in 3D app based on jPCT
« on: April 06, 2010, 11:29:52 am »
OK ,thanks

6
Support / Re: How to blit components in 3D app based on jPCT
« on: April 06, 2010, 05:34:01 am »
use hardware accelerated rendering using OpenGL,maybe i need to use software?

7
Support / How to blit components in 3D app based on jPCT
« on: April 05, 2010, 12:49:24 pm »
HI ,I am back...

First I've to say thanks for this great 3D engine.

but after some tests i got a problem in jPCT Car demo

I want to know how could i add a JTextField or JTextArea in scene of Car demo to accept user's input?

e.g.
there have two textfield "input" and "show"
I input some text in "input" textfield,and when press "send" button,the message was display on "show" textfield

8
Support / Re: How to remove an object3D from world?
« on: March 17, 2010, 04:04:55 am »

Thanks!
Useful info!

you are right,i want to get the car's coordinates.

now i'm writing a network demo for interests based on JPCT Car,I write a method to send local client's coordinates to srever.

car.getTranslation() or car.getTransformedCenter() ...........let me try ^-^

9
Support / Re: How to remove an object3D from world?
« on: March 16, 2010, 01:28:29 pm »
I'm again ,my first question is bad in forum...

I need to take more time to learn JPCT API

now,i'm in trouble again... ~.~

in the JPCT Car demo, in CarTest.java

class CarTest {
...
car=new Car();
car.translate(55, 0, 55);
car.addToWorld(theWorld);
...
}
the car was loaded in this coordinate (55, 0, 55)

then i move the car ,the car's coordinate has changed

i create a method to output the car's coordinate
i use System.out.println("XAxis="+car.getXAxis())  and System.out.println(car.getZAxis())
but output is like XAxis=(****,0,****)   YAxis=(****,0,****)

i want to get the result like XAxis=****   YAxis=****

how to do ?Maybe something is wrong i did ...
 

10
Support / How to remove an object3D from world?
« on: March 15, 2010, 11:49:12 am »
If we want to add an object3D into world we can do this :

World world = new World();
Object3D model1 = ...
Object3D model2 = ...

world.addObject(model1);
world.addObject(model2);

now,if we wang to remove model2 from world , how can we do?

Pages: [1]