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

Topics - JavaMan

#1
Support / Double-Sided Wireframe
July 15, 2015, 11:28:57 PM
Hi all,
It's great to see JPCT still active! I was using it back in '08 and glad to see its continued to be updated. So much for the "Java is dead" talk.  ;D

So, I'm doing some wireframe rendering and thought there was a way to get double-sided rendering for a wireframe. That is the wireframe is rendered irrespective of the rotation within the camera's view.

Anyone have suggestions on how to achieve this other than adding triangles twice?

Thanks,
Vance
#2
Feedback / Object3D Editor file anywhere?
January 26, 2012, 10:48:46 PM
Hi all,
I haven't been around in awhile. Nice to see jpct is continuing to be developed! There are quite a few nice looking projects. :)
Awhile back I wrote a program: the "Object3D Editor." http://www.jpct.net/forum2/index.php/topic,1003.msg6185.html#msg6185
I unfortunately lost the software on my own computer in the middle of some cleaning of my files and would like to know if anyone has a copy on their computer. If someone does, I'd love to get a copy.
Thanks,
Vance
#3
Hey all,
I am thinking about developing an applet for my church website, and using 3D graphics(jpct) in it. People that access this website, though aren't necessarily gamers, and therefore don't necessarily have high-end graphics equipment. So, has there ever been a "survey" to find out how much graphical power the average web visitor has? Or, maybe is there some site that does this periodically?
I want the applet to look good, but I don't want to put so much in that most people won't be able to run it.
Anybody know where this info may be available?
Thanks
Jman.
#4
Well, after piddling around for I think two years, I finally have something in the area of simulation to post on the project forums.

I put this little "thing" together this morning for my mom.
Here's a screen shot. The island mass and house calmly rotate around the y axis.

Her favorite spot in the world would be on a beach, so I thought why not use my favorite graphics engine to put her there? All in crappy textures. ;D



If you want to try it out. Here it is. The main class is Main and I ran it with -Xmx300m
The jar file does not have the main class specified in the manifest so you have to run it in the command line with say

java -cp jpct.jar;lwjgl.jar;MD.jar -Xmx300m Main

assuming jpct,lwjgl,MD and the lwjgl dll are all in the local directory.

http://files.filefront.com/MDjar/;13738529;/fileinfo.html


#5
Feedback / Anyone know about DeVry University?
February 06, 2009, 03:16:54 AM
Hi everyone,
I haven't been very active in a while, so I hope its ok with everyone with me asking on here. Ok, on to my question.
I am applying to various universities. One of them is DeVry University for the online BS in CIS program. I was wondering, has anyone had any experience with DeVry? I have read some horrible things about DeVry, and some good things, but thought maybe some real programmers may know about it.
Thank-you for any help!
Jman
#6
Support / skydome or skybox
September 14, 2008, 03:35:27 PM
I am starting to build some models for a game, and I want to create a sky. So, which is usually more realistic skydome or skybox?
#7
Support / Question on shadows
June 15, 2008, 08:17:40 PM
Hi everyone,

I have been learning how to use shadow mapping in jpct, and I am using the ShadowHelper class to do it. I tried out setting my objects as both casters and receivers so that it would look like things in the real world. Unfortunately, the shadows are very poor quality. Here is a screen shot.


Are you not supposed to set an object as a caster and a receiver? I have the projector moving around in a circle in the world, and the animation of the shadows is smooth, but the shadows are poor.

When I set an object as a receiver or just a caster, the shadows appear smooth.

Thanks
Jman
#8
Support / good sizes for people, terrain?
June 08, 2008, 02:08:10 PM
HI everyone,
I am making some terrain, but I am a little unsure on what is a "good" size for things in a game. I would like to represent the ground under a human with two triangles that form a square. What do you think is a "good" length for one of the sides of the square? What is usually used for something like that? Also, how "tall" should a person be?

I haven't ever done any game programming, and I don't really know about what is good sizes for stuff like this. Any sites describing this can help, or any tips! Thanks

Jman
#9
Support / Another problem with addTriangle?
April 18, 2008, 01:53:47 PM
Hi,
I am trying to take the triangles from a primitive object (cube, sphere, pyramid)
and add them into another object. I can add the triangles from a cube, sphere, pyramid
just fine, but when the object that receives the triangles is rendererd an ArrayOutOfBounds
exception is thrown whenever I had added more than 60 triangles. Here is the code that adds
the triangles.

Quote
class MoldIn {
   private Object3De in;
   private Object3D from;
   private PolygonManager man;
   private static int index=0;
   public MoldIn(Object3De into, Object3D source){
      from=source;
      in=into;
   }

   public void mold(){
      System.out.println("-----IN MOLD() "+index+"--------");
      man = from.getPolygonManager();
      int id = man.getMaxPolygonID();
      in.build();
      in.unbuild();
      for(int i = 0; i<id; i++){
         System.out.println("Copy " + k + "|" + i);
         //System.out.println("" + man.getTransformedVertex(place,0) + " " + man.getTransformedVertex(place,1) + " " + man.getTransformedVertex(place,2) + " ");
         in.addTriangle(man.getTransformedVertex(i,0),man.getTransformedVertex(i,1),man.getTransformedVertex(i,2));
      }
      in.build();
      System.out.println("_________DONE WITH MOLD()_______");
   }

}

Object3De is just a class that extends Object3D. Any ideas why I can't
add more than 60 in? Actualy I can add a cube's trian. 7 times to the
object but after I add the 8th the exception is thrown??
Any ideas?

Jman

Here is the exception that is thrown during the rendering.

Exception in thread "Thread-2" java.lang.ArrayIndexOutOfBoundsException: 56
        at com.threed.jpct.Object3D.transformVertices(Unknown Source)
        at com.threed.jpct.World.renderScene(Unknown Source)
        at Controller.renderNow(Controller.java:181)
        at Controller.run(Controller.java:141)
        at java.lang.Thread.run(Unknown Source)
#10
Would it be possible to have a setTransformedVertex method for the PolygonManager in the next jpct? There is already a getTransformedVertex, but could there be a method that sets the vertex too? Or, is this not even feasible? I know the same thing can be done with a vertexcontroller, but it would be much easier with just a method.

thanks,
Jman
#11
Hi, I was using sphere detection collision in an area of my code, but I decided to change to ray collision. The sphere works ok, but the ray type doesn't get a collision. The objects I used the sphere type are the same I am using for the ray-but it won't work. Here is the area where it is called.

Quote
      //tool.checkForCollisionSpherical(newSimpleVector(0,(tool.getTransformedCenter().y*-1)+30,0),100);
int obh = tool.checkForCollision(new SimpleVector(0,2,0),(tool.getTransformedCenter().y*-1));

When I uncomment the spherical and comment the ray, I get a collision, but when I run the code how it is here, I get no collision???
Config.collideOffset is 300. Any ideas?
Jman
#12
Support / problem with addTriangle after build
March 19, 2008, 10:48:16 PM
Hi, I am trying to add triangles to an object after the object has been built. I noticed that the addTriangle method call works fine, but when the object is renderered it throws an exception. Here is some code to demonstrate.
Quote
import com.threed.jpct.*;

class AddTriTest {

   public static void main(String args[])throws Exception{

   Object3D ob = new Object3D(30);
   ob.addTriangle(new SimpleVector(0,0,0),new SimpleVector(0,100,0),new SimpleVector(100,0,0));
   ob.build();
   
   World world = new World();
   world.setAmbientLight(200,200,200);

   world.addObject(ob);
   world.newCamera();
   
   Camera cam = world.getCamera();
   cam.moveCamera(Camera.CAMERA_MOVEOUT,200);
   
   FrameBuffer fb = new FrameBuffer(800,600,FrameBuffer.SAMPLINGMODE_NORMAL );
   fb.enableRenderer(IRenderer.RENDERER_OPENGL);
   fb.disableRenderer(IRenderer.RENDERER_SOFTWARE);

   world.removeObject(ob);
   ob.addTriangle(new SimpleVector(0,-100,0),new SimpleVector(0,0,0),new SimpleVector(100,-100,0));
   ob.build();
   world.addObject(ob);
         while (!org.lwjgl.opengl.Display.isCloseRequested()) {
         fb.clear();
         world.renderScene(fb);
         world.draw(fb);
         
         fb.update();
         fb.displayGLOnly();
         Thread.sleep(10);
      }
      fb.disableRenderer(IRenderer.RENDERER_OPENGL);
      fb.dispose();
      System.exit(0);
   }
}

Does addTriangle only work before calling buil?
Jman
#13
Support / Projected Textures
March 13, 2008, 03:47:53 PM
How do I get this affect? How the texture appears to move over the bump there.

Could I have a little example, or maybe what class(es) is used for this?
JMan
#14
Support / Getting TexutreInfo from polygon
March 12, 2008, 01:53:47 PM
Hi,
Is there anyway to get the textureinfo of a certain polygon through the polygonmanager,or another way? I see the method for getting a texture, but I want the textureinfo.
Jman
#15
Support / Help with CollisionDetection !!!
March 11, 2008, 04:06:12 AM
Hi, I am learning about collision detection. I have looked around for help with it, and I thought this code would make box1 move until it runs into box2 then stop, but the box just keeps moving with no collision. Why?
Quote
import java.awt.*;
import javax.swing.*;
import com.threed.jpct.*;
import org.lwjgl.opengl.*;
class CanTest {
   public static void main(String args[])throws Exception{
   Config.farPlane=500000;
   final JPanel top = new JPanel();

   final World w = new World();
   Object3D o = new Object3D(200);
   Object3D box1 = Primitives.getCube(60);
   Object3D box2 = Primitives.getCube(60);
   box1.build();
   box2.build();
   box1.translate(900,0,0);
   box1.translateMesh();
   box1.build();
   box1.addCollisionListener(new Lis());
   box2.addCollisionListener(new Lis());
   box1.setTransparency(0);
   box2.setTransparency(0);
   box1.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS|Object3D.COLLISION_CHECK_SELF);
   box2.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS|Object3D.COLLISION_CHECK_SELF);

   w.addObject(box1);
   w.addObject(box2);

   box1.setAdditionalColor(Color.red);
   box2.setAdditionalColor(Color.blue);

   w.setAmbientLight(200,200,200);
   w.newCamera();
   Camera cam = w.getCamera();
   cam.moveCamera(Camera.CAMERA_MOVEOUT,5000);
   cam.moveCamera(Camera.CAMERA_MOVERIGHT,800);

   final FrameBuffer b = new FrameBuffer(800,600,FrameBuffer.SAMPLINGMODE_NORMAL);
   b.enableRenderer(IRenderer.RENDERER_OPENGL,FrameBuffer.SAMPLINGMODE_NORMAL );
   b.disableRenderer(IRenderer.RENDERER_SOFTWARE);

   box1.enableCollisionListeners();
   box2.enableCollisionListeners();

   int i = 0;
   while(i<5000){
         b.clear();
         w.renderScene(b);
         w.draw(b);
         b.update();
         b.displayGLOnly();
   Thread.sleep(100);
   SimpleVector v = box1.checkForCollisionSpherical(new SimpleVector(-10f,0,0),10f);
   box1.translate(v.x,v.y,v.z);
   System.out.println("" + v.x + " " + v.y + " " + v.z);
   }


   }
}

class Lis implements CollisionListener {
   public void collision(CollisionEvent e){
      System.out.println("OUCH!!!!!!!!!!!!");
   }








   public boolean requiresPolygonIDs(){
      return false;
   }
}



Thanks for any help! I really am stumped. ???
#16
Support / Problem with AWTGLRenderer
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.
Quoteimport 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));
   o.build();
   w.addObject(o);
   w.setAmbientLight(200,200,200);
   w.newCamera();
   Camera cam = w.getCamera();
   cam.moveCamera(Camera.CAMERA_MOVEOUT,100);
   
   JFrame f = new JFrame();
   f.setLayout(new GridLayout(1,1));
   f.add(top);
   f.setVisible(true);
   f.setSize(500,500);
   top.setBackground(Color.blue);
        try{ Thread.sleep } catch(Exception e){}
   FrameBuffer b = new FrameBuffer(top.getWidth(),top.getHeight(),FrameBuffer.SAMPLINGMODE_NORMAL);
   final Canvas c = b.enableGLCanvasRenderer();
   b.disableRenderer(IRenderer.RENDERER_SOFTWARE);
   top.setLayout(new GridLayout(1,1));
   top.add(c);
   int i = 0;
   i=0;
   while(i<5000){
         b.clear();
         //System.out.println("RENDERSCENE");
         w.renderScene(b);
         //System.out.println("DRAW");
         w.draw(b);
         //System.out.println("UPDATE");
         b.update();
         //System.out.println("GLONLY");
         b.displayGLOnly();
         //System.out.println("CANVAS__REPAINT");
         c.repaint();
         System.out.println("" + ++i);
   }
   b.dispose();
         FrameBuffer framebuffer =new FrameBuffer(top.getWidth(),top.getHeight(),FrameBuffer.SAMPLINGMODE_NORMAL);   
         System.out.println("E");
         System.out.println("l1");
            framebuffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
   System.out.println("About to crash...");
   /** Uncommenting the line below makes the program crash. */
   //top.remove(c);
   
   /**It doesn't matter is you try this. Still the same result: a crash*/
   /*
   SwingUtilities.invokeLater(new Runnable(){
      public void run(){
         top.remove(c);
      }
   });
   */
   }
}

Anybody, know why this happens? ???
JMan

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
Quote
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:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

[error occurred during error reporting, step 270, id 0xc0000005]
#17
Support / Serializing Object3Ds to file
February 10, 2008, 09:34:23 PM
Hi,
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" java.io.WriteAbortedException: writing aborted; java.
io.NotSerializableException: com.threed.jpct.PolygonManager
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19
  45)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)

        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at Viewer.main(Viewer.java:21)

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?
thanks
jman
#18
Support / ArrayOutofBounds exception probelm
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 Object3Ds.run(Object3DEditor.java:65)
        at java.lang.Thread.run(Unknown 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
#19
Projects / Object3D Editor
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.

www.geocities.com/thejavaman2/Object3DEditor.zip

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:
#20
Support / Glass or shine on objects?
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.
THx
V