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.

Topics - JavaMan

Pages: 1 [2]
Support / Problem with AWTGLRenderer
« on: March 07, 2008, 12:44:35 am »
Hi, I am trying to get a program to render into a Canvas with the GLRenderer, and then when the container around the Canvas becomes bigger, I need to remove the canvas from its container, create a new framebuffer, and add the new canvas from the framebuffer into the container where the old canvas was. I have everything working up to the point where the canvas is removed. Whenver I try to remove the canvas, the program crashes: no exception or anything just Windows tells me java.exe has caused an error and needs to close. I created some code that is like my real code, and creates the crash.
import java.awt.*;
import javax.swing.*;
import com.threed.jpct.*;
class CanTest {

   public static void main(String args[]){
   final JPanel top = new JPanel();

   World w = new World();
   Object3D o = new Object3D(200);
   o.addTriangle(new SimpleVector(0,0,0),new SimpleVector(0,300,0),new SimpleVector(300,0,0));;
   Camera cam = w.getCamera();
   JFrame f = new JFrame();
   f.setLayout(new GridLayout(1,1));
        try{ Thread.sleep } catch(Exception e){}
   FrameBuffer b = new FrameBuffer(top.getWidth(),top.getHeight(),FrameBuffer.SAMPLINGMODE_NORMAL);
   final Canvas c = b.enableGLCanvasRenderer();
   top.setLayout(new GridLayout(1,1));
   int i = 0;
         System.out.println("" + ++i);
         FrameBuffer framebuffer =new FrameBuffer(top.getWidth(),top.getHeight(),FrameBuffer.SAMPLINGMODE_NORMAL);   
   System.out.println("About to crash...");
   /** Uncommenting the line below makes the program crash. */
   /**It doesn't matter is you try this. Still the same result: a crash*/
   SwingUtilities.invokeLater(new Runnable(){
      public void run(){

Anybody, know why this happens? ???

I tried this little program on another computer, and the jre printed out this message before exiting the program, but windows didn't put up that error dialog
About to crash...
# An unexpected error has been detected by Java Runtime Environment:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x696a0508, pid=3752, tid=2748
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C  [nvoglnt.dll+0x1a0508]
# An error report file with more information is saved as hs_err_pid3752.log
# If you would like to submit a bug report, please visit:

[error occurred during error reporting, step 270, id 0xc0000005]

Support / Serializing Object3Ds to file
« on: February 10, 2008, 09:34:23 pm »
I am trying to write an Object3D to a file to be loaded later by another program. The serializing of the Object3D to a file works fine, but when I try to read the file and cast it into an Object3D it gives me this error

C:\ObjectEditor>java Viewer h
Exception in thread "main" writing aborted; java.
io.NotSerializableException: com.threed.jpct.PolygonManager

        at Viewer.main(

There is more to the error output, but what it is saying is that the PolygonManger is not serializable. I know this, but how do you serialize an Object3D without its PolygonManger? The object that I am trying to serialize has gotten getPolygonManger() called on it. When the Object has not had getPolygonManager() called on it, the Object3D serializes fine.
I tried out creating another Object3D and setting this object's mesh to the object that am I trying to serialize. Then I serialize the new object3d, and it obviously works fine, but all my textures naturally disappear. I don't want that. So, how do I serialize an object to a file with all its texture information?

Support / ArrayOutofBounds exception probelm
« on: January 20, 2008, 10:17:24 pm »
Hi, In my Object3DEditor program I am getting a strange problem when I add triangles to objects in the program. The probelm doesn't always happen just here and there, but it when it happens, it happens after adding a triangle to an object3d in the world. Here is the exception

Exception in thread "Thread-2" java.lang.ArrayIndexOutOfBoundsException: 11
        at com.threed.jpct.Object3D.render(Unknown Source)
        at com.threed.jpct.World.renderScene(Unknown Source)
        at Source)

Any ideas as to what is happening here? The Thread-2 is the Thread that is rendering the world into a JPanel.
thanks v

Projects / Object3D Editor
« on: January 16, 2008, 04:25:22 am »
Current Status May 29,08>>I have uploaded a new version of the Editor. This version fixes some problems.

This project is a for creating a simple 3D modeler program for Object3Ds.

With the current version you can create an Object3D from scratch or open up any Object that jpct can load and edit it(3DS,ASC,MD2...).

By editing I mean: setting polygon textures, setting whole object textures, changing polygon vertex data, and adding pre-built objects(cubes, triangles, spheres, planes...) to an object. Plus a few more settings.
When you have the object looking how you want it, you can save a serialized version of the object's mesh, a xml file that contains just the object specified by the jpct dtd, or a xml file that cotains jpct xml file, and extra information that you set in the editor. This third option will copies the necessary image files in to the directory in which you save the xml file. There is a jar file(with class files in it) that you can use to load the object for your jpct program from the xml file. The source is also there.

This is the current version of the program. It has everything implemented! If you have find a bug, please tell me!
This download contains all the files necessary to run the program. It also contains the source.

java -cp Object3DEditor.jar -splash:splash.jpg -Xmx400m Controller
The number after the Xmx option is the minimum amount of memory necessary to run the program. If you are running the program with large objects, and it crashes with a java heap space exception, I suggest you increase the number.

If anyone downloads it, and you have a question, just ask.

Here the program is running with some transparent triangles with textureinfo.

Here is a quick step-by-step to create an object and add a triangle to it.
1: Click New>Object3D Basic
2: fill in the max triangles and the name of the Object3D as seen here.

3: Click on the corresponding button in the left panel which has the title of your new object3d as its title.
    The scroll ares will then update to reflect the selected object that the button represents.
4: Scroll down in the left scroll area and click the triangle button.

5. Then fill in the values for the 1st, 2nd, and 3rd vectors. The row next to the 1 represent the values for what you could picture as in addTriangle(1strow,2ndrow,3rdrod); Then click the done button.

Here are some instructions on how to move the camera.

Some instructions on changing vertex data of polygon.

Info, on texture creation:

Support / Glass or shine on objects?
« on: November 25, 2007, 02:09:02 am »
Quick question:
Can I make objects shiny? Like how light sometimes shines on an object( in the real world) and it creates a glare or shine on the object. I can't see how to do this.

Support / Textures on triangles and textures in general
« on: November 09, 2007, 08:16:44 pm »
Hi I have a quick question for creating objects from triangles and applying textures to them. I created a "box" from primitives.getBox and I was able to apply a texture to it, but how do I do it to an object made from triangles? When I call object3D.setTexture(...) it will apply it to the box but not to the triangle! I also tried putting a TextureInfo refernece into the Object3D.addTriangle but it still doesn't work.

Also, I'm not that clear on textures anyway. Is there some post on this forum that textures were explained or could someone explain them to me? I know texture is what we see when the object is in view and every object has a dummy texture, but about environment mapping base texture.
Hope this isn't too much for one post.

I try not put two posts so close together next time :-\

Support / Jpct tutorial
« on: October 23, 2007, 02:12:59 pm »
In searching for a java 3d engine, I found jpct. I looked at the manual and it seems that this is exactly the way in which I want to create 3d programs. Where can I find a tutorial on jpct? I have searched on the net and I can't find one anywhere. It seems that a lot of people know how to use jpct, but where did you learn?

Pages: 1 [2]