Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 3D / Multiple Geometries or Multiple Shape3D Objects on: 2007-07-20 12:32:13
I have posted this question in other forums because I would like to get opinions from the widest group of Java experts possible.

I would like to know anyone's opinion regarding the memory foot-print for a complex Object.  There could be thousands of separate geometries  (some non-convex).  This may be an obvious question but I would like others opinions if possible, would the memory foot-print difference between a SINGLE Shape3D with thousands of appended Geometries and a wrapper Object composed of thousands of Shape3D Objects be negligible? I am also trying to keep in mind that mouse picking will have to be implemented.

I am trying to avoid the deadly OutOfMemory Error that may happen.

Thanks to anyone who wishes to share their opinion.
2  Java Game APIs & Engines / Java 3D / Re: Mouse Picking with Java3D on: 2007-07-16 12:42:36
Thanks InteractiveMesh  Grin The information you gave was exactly what I needed.
3  Java Game APIs & Engines / Java 3D / Mouse Picking with Java3D on: 2007-07-13 15:18:09
Please help,

I am very new to Java3D and am having some issues with the mouse picking.  I have a Model that I am rendering that is made up of multiple Shape3D Objects.  What I would like to do is allow the user to simply use a mouse click to select one or more of the rendered Shape3D Objects (that make-up the single Model) and change the color of that particular Shape3D Object - a "highlight" of some kind.

If someone out there has some experience doing this type of work can you please help a newbie out with some hints (or even better - some simple code).

Thanks in advance for any help that any one can provide.
4  Java Game APIs & Engines / Java 3D / Re: How to draw solid polygon (newbie) on: 2007-06-28 12:57:27
Fixed the problem!! Grin

It had nothing to do with the GeometryInfo Class. I had forgot to check the direction of the Point3d Objects to be rendered, thus the points sometimes yielded malformed triangle divisions.

Thanks everybody for all the help/hints.  It really helps a newbie like myself.
5  Java Game APIs & Engines / Java 3D / Re: How to draw solid polygon (newbie) on: 2007-06-21 15:07:00
All right,

I think I am begining to understand enough about Java3D to properly ask the question that I have regarding rendering Polygons.  I have a set of Polygons that I would like to render together to form a single Object.  I believe the problem is occurring when I try to append multiple Geometries, the following snippet of code shows what I am trying to do (this Class extends the Shape3D Class):
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
public void setGeometry() {
        // The outers Vector contains a Collection of Polygon Objects (each of which is
      // composed of a series of Point3d Objects)  ...
       //
       for (int i = 0; i < this.outers.size(); i++) {
            this.gInf = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
            Polygon poly = (Polygon)this.outers.get(i);
            Point3d[] outerPts = poly.outerToArray();
            int[] stripCounts = {outerPts.length};
            int[] contourCount = {1};

            this.gInf.setCoordinates(outerPts);
            this.gInf.setStripCounts(stripCounts);
            Triangulator tr = new Triangulator();
            tr.triangulate(this.gInf);
            this.gInf.recomputeIndices();

            NormalGenerator ng = new NormalGenerator();
            ng.generateNormals(this.gInf);
            this.gInf.recomputeIndices();

            Stripifier st = new Stripifier();
            st.stripify(this.gInf);
            this.gInf.recomputeIndices();

           //this.setGeometry(this.gInf.getGeometryArray());
          this.addGeometry(this.gInf.getGeometryArray());
        }// End of FOR-LOOP
}// End of setGeometry()


When I uncomment the setGeometry(this.gInf.getGeometryArray()) and comment-out the addGeometry(this.gInf.getGeometryArray()) methods I get a correct Polygon rendering (although only the LAST polygon in the series represented by the "outers" Vector is rendered.  I am hoping that this is a SIMPLE fix.  Can anyone out there PLEASE help a newbie out?

Thanks in advance.
6  Java Game APIs & Engines / Java 3D / Re: How to draw solid polygon (newbie) on: 2007-06-20 18:29:13
Thank you very much for the reply Conzar. 

However, I probably should clarify the issue a little more.  The Model I am rendering is made up of a series of potentially complex (contain "holes") polygons that may or may not fall on a total vertex number that is a factor of 4.  Each polygon being rendered could have any number of vertices.  When this is the situation what is the best idea to do with Java3D ?

Once again, thank you for the response.
7  Java Game APIs & Engines / Java 3D / How to draw solid polygon (newbie) on: 2007-06-20 13:56:38
Please Help,

I am very new at Java3D and trying to draw a solid polygon based on a set of Points (X, Y, and Z Coordinates). I was using JOGL but like the purely Object-oriented paradigm provided by Java3D. Anyway, I have a series of Points stored in a Vector and need to draw them as a Polygon that is solid. In JOGL I used the following code:
1  
2  
3  
4  
5  
6  
7  
Vector pts = getPoints();
gl.glBegin(GL.GL_POLYGON);
for (int i = 0; i < pts.size(); i++)  {
    PointData p = (PointData)pts.get(i);
    gl.glVertex3f(p.x, p.y, p.z);
}
gl.glEnd();


The problem is that when I have tried it with Java3D using the GeometryInfo Class I sometimes get strange triangulation renderings.  Can anyone out there help a newbie out?

Thanks in advance.
8  Java Game APIs & Engines / JOGL Development / Re: gluNurbsCurve on: 2007-06-04 12:15:02
Thank you for the information.  Do you have any further information on the JGeom to JOGL that some people on this forum have done?  Also, if NURBS is not implemented in JOGL can you tell me what is typically done for Java 3D graphics implementations that need this specific behavior?

Once again, thank you.
9  Java Game APIs & Engines / JOGL Development / gluNurbsCurve on: 2007-06-02 12:38:50
Please Help,

I am developing some code that is being transfered from C++ to Java and NURBS are used heavily.  Does anybody know if the gluNurbsCurve function has been implemented in JOGL, if so does anybody have a quick and simple example of its use?

Thanks in advance for any help or hints.
10  Java Game APIs & Engines / JOGL Development / Saving GLUTessellation Data on: 2007-04-10 17:18:44
This may be a stupid question but I am still fairly new to JOGL, so here goes:

I would like to save the data that is generated by GLUTessellatorCallback interface (when implemented).  The polygons I will be rendering could be quite complex and so I would like to save the tessellated polygons as an array that can be used for rendering later.  Is this possible? If so, how? 

Any hints/simple code would be great.  Thanks in advance.
11  Java Game APIs & Engines / JOGL Development / Re: Polygon "holes" on: 2007-03-09 18:21:18
Never mind, I figured it out.  It seems I forgot to define the combine method for Callbacks (stupid newbie mistake).
12  Java Game APIs & Engines / JOGL Development / Re: Polygon "holes" on: 2007-03-08 21:13:41
Thanks for the help guys.

I have been trying to implement the Tesselation but keep running into an error when I execute:
"Java.lang.ArrayOutOfBoundException: 6 " followed by "Tessellation Error: Out of Memory".  I have no idea what could be causing this. Samples of my code follow:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
// Shape is a Class that contains Two Arrays: 
// 1 that has X, Y, Z Coordinates of Polygons that are to be "holes" and
// 2. X, Y, Z Coordinates of Polygons that are Solid
// Get the Vector of Shape Objects
Vector vecHoles = this.dm.getFinalFaceHoleObjects();
for (int i = 0; i < vecHoles.size(); i++) {
    GLU glu = new GLU();
    tessellCallBack tessCallback = new tessellCallBack(gl, glu);
    GLUtessellator tobj = glu.gluNewTess();
    glu.gluTessCallback(tobj, GLU.GLU_TESS_VERTEX, tessCallback);
    glu.gluTessCallback(tobj, GLU.GLU_TESS_BEGIN, tessCallback);
    glu.gluTessCallback(tobj, GLU.GLU_TESS_END, tessCallback);
    glu.gluTessCallback(tobj, GLU.GLU_TESS_ERROR, tessCallback);
 
   // Get the double[][] for "holes" and "non-holes" respectively
 double[][] holePts = sp.getArrayHolePts();
  double[][] wholePts = sp.getArrayPts();

  glu.gluTessBeginPolygon(tobj, null);
  glu.gluTessBeginContour(tobj);
  for (int j = 0; j < wholePts.length; j++) {
      glu.gluTessVertex(tobj, wholePts[j], 0, wholePts[j]);
  }// End of FOR-LOOP
 glu.gluTessEndContour(tobj);
  glu.gluTessEndPolygon(tobj);
  glu.gluDeleteTess(tobj);

   ...
}// End of OUTER FOR-LOOP

// Here I implement the GLUtessellatorCallbackInterface --> Only showing methods I implemented
class tessellCallBack implements GLUtessellatorCallback {
    private GL gl;
    private GLU glu;

    public tessellCallBack(GL gl, GLU glu) {
         this.gl = gl;
         this.glu = glu;
    }

    public void begin(int type) {
         gl.glBegin(type);
    }

    public void end() {
         gl.glEnd();
    }

    public void vertex(Object vertexData) {
         double[] pointer;
         if (vertexData instanceof double[]) {
              pointer = (double[])vertexData;
      gl.glVertex3dv(pointer, 0);
         }
  }

  public void error(int errnum) {
         String estring;
         estring = glu.gluErrorString(errnum);
         System.err.println("Tessellation Error: " + estring);
         System.exit(0);
    }// End of error(int)
}// End of tessellCallBack
 


I am hoping it is something obvious but I just can't see it at this point.  I hope that one of you JOGL Gurus have an idea. 

Once again, Thanks.
13  Java Game APIs & Engines / JOGL Development / Re: Polygon "holes" on: 2007-03-08 13:12:15
Thanks for all the quick replies.

So using tessellation should up the performance - at least over multiple calls to the STENCIL Buffer? 
14  Java Game APIs & Engines / JOGL Development / Polygon "holes" on: 2007-03-06 13:31:40
Please Help,

I am trying to render a group of polygons that have "holes" cut-out in them using JOGL. I have been using the STENCIL Buffer and creating a mask but as the polygons got more numerous the performance has dropped.  I am fairly new to JOGL, does anybody know of a way using JOGL that this can be accomplished without using the STENCIL Buffer?  Some simple code would be great but at this point ANY help would be appreciated.

Thanks in advance.
15  Java Game APIs & Engines / JOGL Development / NURBS on: 2007-02-26 20:15:05
I am assuming that NURBS are not offered by JOGL (please correct me if I am wrong). 

I have heard that the jGeom library can be used instead for NURBS. Does anybody have some simple code showing this or point me to a tutorial?  Even some simple intro into how to properly install the jGeom library would be great.

BTW, I hope I am wrong about NURBS not being offered in JOGL since I have invested a lot of code to JOGL and rather like the simple interface.

Thanks in advance.
16  Java Game APIs & Engines / JOGL Development / Re: MouseMovement with JOGL on: 2007-02-20 14:42:58
Does anybody know where I can see some simple example code using JOGL with mouse interaction such that the user can click and drag the Object around on the screen?  I know there are probably easier ways (such as using gleem) but I am trying to learn from the ground-up and any hints or help would be greatly appreciated.

Thanks in advance. Smiley
17  Java Game APIs & Engines / JOGL Development / Re: MouseMovement with JOGL on: 2007-02-20 13:15:00
I will definately take a look at the gleem classes.
18  Java Game APIs & Engines / JOGL Development / MouseMovement with JOGL on: 2007-02-19 19:59:43
Please Help,

I posted a question related to this previously but believe I may have put it in the wrong place - if this is considered a re-post I appologize but I hope someone can help.
I have an image rendered in JOGL and would like to be able to "move" it by holding the RIGHT-MOUSE Button down and dragging it. I am sure I have to save the changes in X and Y Coordinates and apply to the glTranslate (maybe?). 

I am really looking for some simple code in JOGL that illustrates movement with a mouse drag.  I can get some movement but it is jittery and almost random.

Thanks to any one with some help or hints.
19  Game Development / Newbie & Debugging Questions / Re: Basic Newbie Rotation, Movement on: 2007-02-19 19:06:26
Thanks for the inof erickd. I will give the rotate and translate functions a try. Smiley
20  Game Development / Newbie & Debugging Questions / Basic Newbie Rotation, Movement on: 2007-02-19 13:37:04
Please Help,

I am pretty new to JOGL (fairly good at Java) and have a few questions that are probably easy. 

First:
Given that I have a Model displayed and have calculated the center point of the model (in X, Y, and Z coordinates), what is the easiest way to rotate that model around the given center point with the mouse cursor?

Second:
How does one go about moving a displayed model using JOGL with the mouse cursor?

Lastly,
I am debating the merits of JOGL vs. the Java 3D API, what is the general consensus among the two?
Are there any good books regarding Java 3D or JOGL that anyone would recommend ?

Thanks in Advance.
21  Java Game APIs & Engines / JOGL Development / Re: Newbie MouseListener JOGL Help on: 2006-10-23 12:46:00
Thank you Ken.
22  Java Game APIs & Engines / JOGL Development / Newbie MouseListener JOGL Help on: 2006-10-22 23:02:01
PLEASE help,

I am a newbie to JOGL but am eager to learn.  All I need is some simple code example on how to display a line drawing (e.g., a 3D cube) that can be moved by the mouse (such as when the user would "grab" a corner of the cube and "spin" it).  I am very new to this and know that it is probably very easy but some simple code that I can then build on would be GREAT Grin.  I am using Windows XP and J2sdk1.4.2_12 with JOGL JSR231 1.0.0 (Sept. 2006 release).

Thank you to anyone that can help.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (42 views)
2014-08-19 09:29:53

Tekkerue (41 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (26 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (73 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!