Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  GeometryInfo replacement  (Read 2513 times)
0 Members and 1 Guest are viewing this topic.
Offline abies

Senior Devvie





« Posted 2003-12-28 18:00:18 »

Just to let you know and avoid duplicate work. I'm currently working on java3d GeometryInfo replacement. It will support vertex optimizer, normal generator (both flat and per-face smooth group) and vertex-cache aware stripifier. I want to allow any combination of raw data/mixed indices as input geometry - but only for triangles. I do not plan to work on polygon to triangle division at the moment, but it should be possible to stick it just before my GeometryInfo.

Artur Biesiadowski
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #1 - Posted 2003-12-29 05:48:15 »

This is great, because of I have now trivial indexer/unindexer and was thinking about something like GeometryInfo replacement.

In the meantime, I think it may be good to adapt Xith3D renderer to support mixed geometry.

Yuri

Yuri Vl. Gushchin
JProof Group
Offline Preston

Senior Devvie


Medals: 4



« Reply #2 - Posted 2003-12-29 06:13:59 »

Quote
Just to let you know and avoid duplicate work. I'm currently working on java3d GeometryInfo replacement. It will support vertex optimizer, normal generator (both flat and per-face smooth group) and vertex-cache aware stripifier.

Very nice. The normal generator I could use straight away. :-)

Are there plans already when this will be added to Xith3d?

Nearly can't wait. ;-)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abies

Senior Devvie





« Reply #3 - Posted 2003-12-29 21:00:36 »

How do you propose to name process of finding vertices with same coordinates and merging them into one index (and opposed operation, where every face gets 3 unique indexes to 3 unique vertices) ?

To this point I was calling it optimize/deoptimize - but I also use these words to denote vertex cache optimalization, which is totally unrelated. Any ideas about the names for the operations ? Here are my ideas

mergeVertices / splitVertices
compactVertices / expandVertices
unifyVertices / ?Vertices
makeSimilarVerticesTheSame/makeTheSameVerticesDifferent Smiley

Artur Biesiadowski
Offline abies

Senior Devvie





« Reply #4 - Posted 2003-12-30 08:58:51 »

Before it can work, I need few corrections to main xith3d code.

First one is to add support for indexed triangle strips. Here is quick and dirty code - I don't like it, because it creates temporary buffer object per each strip, but it was fastest for now (this should go into ShapeAtomPeer). In future, it will have to be refactored anyway to allow to use VBO for indices.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
} else if (geoArray instanceof IndexedGeometryArray) {

            if (geoArray instanceof IndexedTriangleArray) {
                mode = GL.GL_TRIANGLES; // say that we want to draw points
                IndexedGeometryArray igeoArray = (IndexedGeometryArray) geoArray;
                gl.glDrawElements(mode, igeoArray.getValidIndexCount(), GL.GL_UNSIGNED_INT, igeoArray.getIndexData().getIntBuffer());
            } else if ( geoArray instanceof IndexedGeometryStripArray ) {
                mode = GL.GL_TRIANGLE_STRIP;
                IndexedGeometryStripArray igsa = (IndexedGeometryStripArray)geoArray;
                int[] strips = igsa.getStripVertexCounts();
                int start = 0;
                for (int s = 0; s < strips.length; s++) {
                    gl.glDrawElements(mode,strips[s],GL.GL_UNSIGNED_INT,((IntBuffer)igsa.getIndexData().getIntBuffer().position(start)).slice());
                    start += strips[s];
                }
               
               
            }
           
        } else {
            gl.glDrawArrays(mode, geoArray.getInitialVertexIndex(), geoArray.getValidVertexCount());
        }


Then, in GeomContainer, setNormal should be
1  
2  
3  
public void setNormal(int int0, Vector3f vector3f) {
    normals.setFloats(int0*3,vector3f);
}


not (int0,vector3f) as it is now.

IndexedGeometryStripArray constructor should be
1  
2  
3  
public IndexedGeometryStripArray(int type, int vertexCount, int vertexFormat, int indexCount, int []stripIndexCounts) {
          super(type,vertexCount,vertexFormat,0,null,stripIndexCounts,indexCount);
      }

Currently stripIndexCounts are ignored.

It would be also nice to intialize validIndexCount to maxIndexCount in GeomIndexedContainer - currently it is 0 and it is very easy to forget to intialize it, as it is not in constructor.

Artur Biesiadowski
Offline abies

Senior Devvie





« Reply #5 - Posted 2003-12-30 11:56:57 »

http://nwn-j3d.sourceforge.net/xith3d/geomdata.zip

Interesting classes are geomdata.XithGeometryInfo and geomdata.GeometryCreator.

Color/tex coord support is untested - it should work, as it is similar code to rest of components, but I might had done some copy/paste mistake. Javadocs are a bit sparse, but I  hope you should be able to get it working.

Artur Biesiadowski
Offline mix

Senior Newbie




In the long run, we're all dead. - Keynes


« Reply #6 - Posted 2003-12-30 19:32:40 »

Will these helper classes become part of the xith core, or will they go in the toolkit?

Eric
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #7 - Posted 2003-12-30 20:25:24 »

Quote
How do you propose to name process of finding vertices with same coordinates and merging them into one index (and opposed operation, where every face gets 3 unique indexes to 3 unique vertices) ?


Don't most modeling programs call this weld & unWeld?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline mix

Senior Newbie




In the long run, we're all dead. - Keynes


« Reply #8 - Posted 2003-12-30 20:47:29 »

@Orangy - Yep, sounds like a good name for it
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #9 - Posted 2003-12-31 07:18:22 »

abies,

Should I add your proposed changes to CVS or you feel this is too early? [also having in mind our discussion on unified geometry container, http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1071694462, "Mixed geometry in Shape3d"]

Yuri

Yuri Vl. Gushchin
JProof Group
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abies

Senior Devvie





« Reply #10 - Posted 2003-12-31 08:08:31 »

Quote

Should I add your proposed changes to CVS or you feel this is too early?


setNormal is no-brainer, because it is a bug. Third one is optional - I don't think it will break anything and can save some frustration for newcomers. As for the first - I would suggest to apply it now, as we can wait for mixed geometry for some time (as there are few issues to be resolved there) and ability to use indexed strips is IMHO quite important.

I would like to put geom creator into xith-tk first, but I before that it would be good somebody else would try to use it and maybe comment about problems/API etc ? It is later rather hard to rename files in CVS.

P.S.
I'll change name to weldVertices and unweldVertices, rename package names and put new version in few hours.

Artur Biesiadowski
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #11 - Posted 2003-12-31 08:21:49 »

Quote
I'll change name to weldVertices and unweldVertices, rename package names and put new version in few hours.


Than maybe a diff submitted to Issuezilla, so it will be trivial for me to apply? Thanks in advance!

Quote
I would like to put geom creator into xith-tk first, but I before that it would be good somebody else would try to use it and maybe comment about problems/API etc ?


I can try it with my app - I have indexing/unindexing code centralized, so I'd like to add stripification there, too, so we can test.

Yuri

Yuri Vl. Gushchin
JProof Group
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

rwatson462 (31 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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