jPCT - a 3d engine for Java > Support

Is There any Applet example?

(1/2) > >>

gpsunjp:
Hello,

I am a newer to JPCT. I want to make a Applet to display a 3D 3DS Object using JPCT. It will be very appreciated if anyone could give me such example.

Thank you

sun

EgonOlsen:
Depends on what kind of applet it should be (passive rendering/normal Swing/AWT/GUI-applet vs. active rendering). For the latter, a very simple example is in this thread (it's a german thread but the code should be clear regardless of this): http://www.jpct.net/forum/viewtopic.php?t=474
That's for software renderer only. When using OpenGL in an applet, things are getting more complicated...

gpsunjp:
Thank you for your reply.
I compiled the applet example but the applet can not be inited when executing.

I also compiled the bounce.java taken from jpctapi_096.zip with current jpct, it can not be inited too.

Anyone know why?

Sun
[/img]

gpsunjp:
Let me give some supplementary error messages.

java.lang.NoClassDefFoundError: com/threed/jpct/FrameBuffer
        at ExampleApplet.init(ExampleApplet.java:20)
        at sun.applet.AppletPanel.run(AppletPanel.java:354)
        at java.lang.Thread.run(Thread.java:534)

My pc installed Java1.5.

Sun

manumoi:
Ok. It s not a big problem i think. You need to verify that the jpct.jar file is correctly linked to your project. So you have to add its path to the CLASSPATH variable of your system (or directly in the command line when you launch your system, using the -classpath attribute).

There are other threads in the forum that are talking about the same problem. (just check it by making a research with the "classpath" keyword)

Another element that you have to put in the classpath is the lwjgl.jar file. You must also give an access to the lwjgl library.

When you want to add a jar file to an applet, you can do it this way


--- Code: ---
<APPLET CODE=a.class
     ARCHIVE="abc.jar" // the url of the jar file to add
     WIDTH=100
     HEIGHT=100>
</APPLET>

--- End code ---


Emmanuel

Navigation

[0] Message Index

[#] Next page

Go to full version