DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Posted
2003-08-03 03:59:04 » |
|
I have pretty much finished porting Magicosm to Xith3D. There are a few things I still have to do, but it is looking pretty good. http://www.magicosm.net/xith3d/cosm1051a.jpgThe frame rates seem comparable to Java3d, but I know there is lots I can do still to improve performance. We are also horribly CPU heavy, running at about 30 percent of the frame rate is spent calculating the next frame. I had hoped that a scene like above would render a lot faster than 41 fps at 1152x864x32, and I hope I can figure out the issues. Does anyone know if the jogl canvas.display() returns as soon as my GL code is done, or does it wait for opengl to finish drawing and swap a frame? It would be nice to get some overlap there if possible. I have not committed my latest Xith3d code yet, I need to clean up some debugging code I still ahve in there.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
gregorypierce
|
 |
«
Reply #1 - Posted
2003-08-03 04:13:23 » |
|
There isn't a glFinish inside the render loop if that's what you're asking. At least I don't see one in the source anywhere.
|
http://www.gregorypierce.comShe builds, she builds oh man When she links, she links I go crazy Cause she looks like good code but she's really a hack I think I'll run upstairs and grab a snack!
|
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #2 - Posted
2003-08-03 04:19:09 » |
|
Ok thats good to know. I will have to do some profiling and see where the time is being spent. The funny thing is that before I had view frustum culling working I was rendering 200,000 triangles a frame at 23 fps, but with culling it is more like 40-50k a frame at 41.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
Games published by our own members! Check 'em out!
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #3 - Posted
2003-08-06 12:21:23 » |
|
We ran a sucessful test on Linux last night of Magicosm running on Xith3D+JOGL. It worked right the first time with no issues.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
swpalmer
|
 |
«
Reply #4 - Posted
2003-08-06 12:50:29 » |
|
We ran a sucessful test on Linux last night of Magicosm running on Xith3D+JOGL. It worked right the first time with no issues.
Sweet. All the joking about "write once, debug everywhere" aside, this is the sort of thing that gives you that reassuring feeling that this Java thing is actually working.
|
|
|
|
aNt
|
 |
«
Reply #5 - Posted
2003-08-06 13:23:49 » |
|
duss animation on ase files work?
|
|
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #6 - Posted
2003-08-06 13:27:09 » |
|
Yeah I kept saying "are you sure you are running the new version"? and he said "well unless you added shadows to Java3d then this is the new version.
Well I was jumping up and down and poured myself a glass of 30 year old Balvinie to celebrate.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
Mojomonkey
|
 |
«
Reply #7 - Posted
2003-08-06 13:35:54 » |
|
Let's see a screen shot!!!
|
Don't send a man to do a monkey's work.
|
|
|
endolf
|
 |
«
Reply #8 - Posted
2003-08-06 20:47:23 » |
|
Hi Sounds like xith is going from strength to strength, is this the same version thats in CVS?, I dunno if I was doing something wrong but I just can't get it to play right with polygon arrays rather than triangle arrays/fans. AC3D fromat is for polygons and getting the underlying renderer to deal with it, running on top of xith rather than Java3D would mean GL does the triangulation which means what you see in the modeler is what you see on the screen  . If the current xith3d should be able to cope with polygon arrays then i'm doing something wrong, if it can't, any ideas when/if it will, or am I gonna have to try and triangulate the models myself?  Edit: I just checked the latest build out, and noticed a class I already had, GeometryArray, i dunno how I missed it last time, it was probably late then too  Also tried to build it with ant on a SDK without java3d installed and I still get build errors unless I build on the java3d enabled sdk, is this a known thing that just wasn't on the top of the priority list?, I know it's very early days yet so I don't expect everything to have been resolved yet, just trying to guage if its ready for me to try and port my AC3D loader. Cheers Endolf
|
|
|
|
William Denniss
|
 |
«
Reply #9 - Posted
2003-08-06 23:04:05 » |
|
Endolf, I am using Xith3D from CVS without Java3D installed for this SDK. The current build does have a few dependencies the ones which I noticed are: vecmath.jar j3dutils.jar I just placed them in $JAVA_HOME/ And it built fine  There is a free implementation of vecmath out there - and the j3dutils.jar file comes as an extra to Java3D, not part of the core IIRC I must say that I am very impressed with what I have seen so far David, well done! Loading a Max-exported ASE file (with materials) was a breeze (well some documentation would have been nice, but that can wait  ). The next time I am coding, I will be porting what I have done in Java3D into Xith3d (not a great deal thus far, but it's nice to be able to keep it). Shadows seem a little odd for more complex meshes but I understand you are working on it (and the very fact there are shadows is enough to wet my appetite!) Cheers, Will.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
aNt
|
 |
«
Reply #10 - Posted
2003-08-07 10:37:00 » |
|
any news on Transparency? still haveing hassles here.. i got and built the new build ok.. code test is the same:
Shape3D shape = new Shape3D(); Appearance a = new Appearance(); a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes. POLYGON_FILL, PolygonAttributes.CULL_BACK, 0)); a.setTexture(textureWood); Geometry g = createDoubleCube(0f, 0, 0, 0.5f, false); a.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.5f)); shape.setAppearance(a); shape.setGeometry(g); tf_2.addChild(shape);
also tryed adding:
view.setTransparencySortingPolicy(view.TRANSPARENCY_SORT_GEOMETRY);
no joy still.. any idea? or is it not in there yet...
|
|
|
|
endolf
|
 |
«
Reply #11 - Posted
2003-08-07 12:17:57 » |
|
Hi Just looked again, GeometryArray isn't any good to me at the moment as the types don't include GEOM_POLY or what ever it will/might become
Cheers
Endolf
(now confused as to wether he is confused or not)
|
|
|
|
aNt
|
 |
«
Reply #12 - Posted
2003-08-07 12:25:32 » |
|
messing with the ASE loaded cant seem to get the materials to work. the loader says they have loaded but all comes out white.
try { BranchGroup bg = AseFile.getModel("test.ase"); tf_2.addChild(bg); } catch (Exception er) { System.out.println("cant load mod: " + er.toString()); }
Parsing material list Parsed material TestMaterual Geom Object Starting 576 faces use material 0 Geom Object Torus01 parsed Shape Torus01 using material ref 0 Getting mesh for sub-material -1 with 576 faces Occluder found 576 faces Occluder found 288 unique points connected 864 edges out of 1728 starting frame speed test Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl OpenGL Renderer = GeForce4 460 Go/AGP/SSE2 OpenGL Version = 1.3.1 OpenGL Vendor = NVIDIA Corporation
|
|
|
|
endolf
|
 |
«
Reply #13 - Posted
2003-08-07 12:33:57 » |
|
Hi I'm no xith expert, but from what i've seen you need to add your model to the universe just like in java3d and then call renderOnce() repeatidly, before the first call the screen is white, and after the last render is called the screen seems to revert to white, loop round 1000 times or something, that should draw it for a few seconds.
HTH
Cheers
Endolf
|
|
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #14 - Posted
2003-08-07 12:40:11 » |
|
shape level transparency is not supported yet. Transparency through textures or vertex alphas *is* supported. I will write a transparency demo to show how this works.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
aNt
|
 |
«
Reply #15 - Posted
2003-08-07 12:50:02 » |
|
cool u the man! i worked out u need a texture are a matrial and its cool  tops.. np there. seems u cant use the colors settings in the file. no big deal.. the shadows are tops dude.. very cool..
|
|
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #16 - Posted
2003-08-07 12:58:21 » |
|
edolf:
What is GEOM_POLY? I am not familiar with that. If you mean by poly a arbitrary polygon with more than 4 sides then I am not aware that OpenGL can render such a thing... it would have to be broken down into triangles first.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
Orangy Tang
|
 |
«
Reply #17 - Posted
2003-08-07 13:19:45 » |
|
glBegin will accept a GL_POLYGON for convex object rendering, but its pretty unstable. Odds are the driver will split it into triangles itself, so you're better off doing it yourself so you don't get unexpected results (particularly with per-vertex colours). I'm rendering convex hulls for my 2d game, and i've found it works better by finding a center point (avarage of all the edge points) and using this as the anchor for a tri fan. This way the results are consistant and i get more control of the interpolated colours 
|
|
|
|
aNt
|
 |
«
Reply #18 - Posted
2003-08-07 13:53:09 » |
|
can i set the shadow volume to a different color? say less transparent?
|
|
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #19 - Posted
2003-08-07 14:48:37 » |
|
I need to add some more support for shadows, a important one being the ability to set the color of the shadow, which would be easy to do.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
aNt
|
 |
«
Reply #20 - Posted
2003-08-07 15:04:14 » |
|
would be cool- then some stuff could have hard darker shadows and others softer colour shadows.
note on collision's.. if i have a airplane flying around and what to see if it crashes into the ground. what sort of collision detection should i use? i still want the airplane to fly around the mountains and stuff.
[the airplane and the terrain are both ase files]
also what do u add a Background to? (view i thought but didnt see to work).
|
|
|
|
endolf
|
 |
«
Reply #21 - Posted
2003-08-07 17:06:29 » |
|
Hi like OrangeTangy said, glBegin can have GL_POLYGON as it's type, my understanding is that sgi have some algorithm in glu utilities that triangulates it, but the source is closed otherwise I would have pinched it and implemented it  . I was thinking that at some point GemoetryArray in xith3d would accept GEOM_POLY, like it has GEOM_TRI etc, but I guess this isn't planned for? Currently i'm playing with using java3d's GeometryInfo and Triangulator, then extrackign the triangle arrays and triangle strip arrays and creating xith versions of them, but i'm not having much success, the background colour seems grey rather than black, and most of the shapes in my model don't show up, even though they have been set to do no face culling. Grrr  Endolf
|
|
|
|
aNt
|
 |
«
Reply #22 - Posted
2003-08-07 19:48:31 » |
|
cool i thought it was just me- the Background just comes out gray here also.
but its cool it will get there.. all top stuff
|
|
|
|
hawkwind
Junior Devvie  
Java games rock!
|
 |
«
Reply #23 - Posted
2003-08-08 12:21:02 » |
|
rats!!! all you people are having fun an I am not. I run the latest (via cvs) xith3d and get a two shades of black empty screen. The most recent pull has some opengl diags in it an mine shows up as an nvidia cards support opengl 1.2.2, 0 triangles and ...wahoo 5 fps. Any ideas??? Basically I have dell inspiron, GeForce go with 16mb running windowz ME. jdk1.4.1 I am interested in the configurations you all are running that work 
|
|
|
|
aNt
|
 |
«
Reply #24 - Posted
2003-08-08 13:25:43 » |
|
Toshiba Laptop Win XP Home Edition sp1 P4 2.6GHz 1GB RAM GeForce4 460 Go 64MB OpenGL Installable client driver 6.12.10.3230
All works bar some little things.. All fansastic!
|
|
|
|
aNt
|
 |
«
Reply #25 - Posted
2003-08-10 15:18:39 » |
|
David if i make a triPatch in 3DsMax or a Plain Object (coverted Plain to a Ploy 3 sides). it seems to not load correctly.. the polygons seem to be all over the shop.
any ideas? here is my model file:
*3DSMAX_ASCIIEXPORT 200 *COMMENT "AsciiExport Version 2.00 - Sun Aug 10 18:17:25 2003" *SCENE { *SCENE_FILENAME "" *SCENE_FIRSTFRAME 0 *SCENE_LASTFRAME 100 *SCENE_FRAMESPEED 30 *SCENE_TICKSPERFRAME 160 *SCENE_BACKGROUND_STATIC 0.0000 0.0000 0.0000 *SCENE_AMBIENT_STATIC 0.0000 0.0000 0.0000 } *MATERIAL_LIST { *MATERIAL_COUNT 1 *MATERIAL 0 { *MATERIAL_NAME "2 - Default" *MATERIAL_CLASS "Standard" *MATERIAL_AMBIENT 0.5882 0.5882 0.5882 *MATERIAL_DIFFUSE 0.5882 0.5882 0.5882 *MATERIAL_SPECULAR 0.9000 0.9000 0.9000 *MATERIAL_SHINE 0.1000 *MATERIAL_SHINESTRENGTH 0.0000 *MATERIAL_TRANSPARENCY 0.0000 *MATERIAL_WIRESIZE 1.0000 *MATERIAL_SHADING Blinn *MATERIAL_XP_FALLOFF 0.0000 *MATERIAL_SELFILLUM 0.0000 *MATERIAL_FALLOFF In *MATERIAL_XP_TYPE Filter *MAP_DIFFUSE { *MAP_NAME "Map #2" *MAP_CLASS "Bitmap" *MAP_SUBNO 1 *MAP_AMOUNT 1.0000 *BITMAP "GRASS2.JPG" *MAP_TYPE Screen *UVW_U_OFFSET 0.0000 *UVW_V_OFFSET 0.0000 *UVW_U_TILING 1.0000 *UVW_V_TILING 1.0000 *UVW_ANGLE 0.0000 *UVW_BLUR 1.0000 *UVW_BLUR_OFFSET 0.0000 *UVW_NOUSE_AMT 1.0000 *UVW_NOISE_SIZE 1.0000 *UVW_NOISE_LEVEL 1 *UVW_NOISE_PHASE 0.0000 *BITMAP_FILTER Pyramidal } } } *GEOMOBJECT { *NODE_NAME "Plane01" *NODE_TM { *NODE_NAME "Plane01" *INHERIT_POS 0 0 0 *INHERIT_ROT 0 0 0 *INHERIT_SCL 0 0 0 *TM_ROW0 1.0000 0.0000 0.0000 *TM_ROW1 0.0000 1.0000 0.0000 *TM_ROW2 0.0000 0.0000 1.0000 *TM_ROW3 -1.1022 2.8036 0.0000 *TM_POS -1.1022 2.8036 0.0000 *TM_ROTAXIS 0.0000 0.0000 0.0000 *TM_ROTANGLE 0.0000 *TM_SCALE 1.0000 1.0000 1.0000 *TM_SCALEAXIS 0.0000 0.0000 0.0000 *TM_SCALEAXISANG 0.0000 } *MESH { *TIMEVALUE 0 *MESH_NUMVERTEX 9 *MESH_NUMFACES 8 *MESH_VERTEX_LIST { *MESH_VERTEX 0 -201.1022 -197.1964 0.0000 *MESH_VERTEX 1 -1.1022 -197.1964 0.0000 *MESH_VERTEX 2 198.8978 -197.1964 0.0000 *MESH_VERTEX 3 -201.1022 2.8036 0.0000 *MESH_VERTEX 4 -1.1022 2.8036 0.0000 *MESH_VERTEX 5 198.8978 2.8036 0.0000 *MESH_VERTEX 6 -201.1022 202.8036 0.0000 *MESH_VERTEX 7 -1.1022 202.8036 0.0000 *MESH_VERTEX 8 198.8978 202.8036 0.0000 } *MESH_FACE_LIST { *MESH_FACE 0: A: 3 B: 0 C: 4 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 1: A: 1 B: 4 C: 0 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 2: A: 4 B: 1 C: 5 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 3: A: 2 B: 5 C: 1 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 4: A: 6 B: 3 C: 7 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 5: A: 4 B: 7 C: 3 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 6: A: 7 B: 4 C: 8 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 *MESH_FACE 7: A: 5 B: 8 C: 4 AB: 1 BC: 1 CA: 1 *MESH_SMOOTHING 1 *MESH_MTLID 0 } *MESH_NUMTVERTEX 0 *MESH_NUMCVERTEX 0 *MESH_NORMALS { *MESH_FACENORMAL 0 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 3 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 0 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 4 0.0000 0.0000 1.0000 *MESH_FACENORMAL 1 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 1 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 4 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 0 0.0000 0.0000 1.0000 *MESH_FACENORMAL 2 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 4 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 1 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 5 0.0000 0.0000 1.0000 *MESH_FACENORMAL 3 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 2 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 5 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 1 0.0000 0.0000 1.0000 *MESH_FACENORMAL 4 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 6 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 3 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 7 0.0000 0.0000 1.0000 *MESH_FACENORMAL 5 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 4 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 7 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 3 0.0000 0.0000 1.0000 *MESH_FACENORMAL 6 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 7 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 4 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 8 0.0000 0.0000 1.0000 *MESH_FACENORMAL 7 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 5 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 8 0.0000 0.0000 1.0000 *MESH_VERTEXNORMAL 4 0.0000 0.0000 1.0000 } } *PROP_MOTIONBLUR 0 *PROP_CASTSHADOW 1 *PROP_RECVSHADOW 1 *MATERIAL_REF 0 }
|
|
|
|
aNt
|
 |
«
Reply #26 - Posted
2003-08-10 15:31:10 » |
|
this is what i get in xith3d:  and this what it should be:  any ideas fella?
|
|
|
|
aNt
|
 |
«
Reply #27 - Posted
2003-08-10 17:07:54 » |
|
rrrr- ok i sorted it.. seems u need more then one object in the file. if u just have like one object it dont work.. np.. just make a small triangle off to one side. and all is cool...
|
|
|
|
DavidYazel
Junior Devvie  
Java games rock!
|
 |
«
Reply #28 - Posted
2003-08-10 19:42:25 » |
|
Bug noted, I will see what I can do to fix it.
|
David Yazel Xith3D Project Founder http://xith3d.dev.java.netIt may look complicated, but in the end it is just a bunch of triangles
|
|
|
aNt
|
 |
«
Reply #29 - Posted
2003-08-11 10:31:55 » |
|
dudes one strange thing..
if i: BranchGroup top_group = new BranchGroup(); BranchGroup hellcat_group = new BranchGroup();
hellcat_group.addChild(hellcat_group_rota); hellcat_group_rota.addChild(hellcat_group_trans); hellcat_group_trans.addChild(hellcatModel); top_group.addChild(hellcat_group); locale.addBranchGraph(top_group);
it seems when i move and rotate my model: hellcat_trans.z = hellcat_trans.z + -1f; hellcat_translation.setTranslation(hellcat_trans); hellcat_group_trans.setTransform(hellcat_translation);
hellcat_rotation.rotXYZ(updown, 0f, leftright); hellcat_group_rota.setTransform(hellcat_rotation);
the model rotates around the centre point of the VirtualUniverse. and not around itself. i want to rotate the object then move it along its z. so what ever direction the object it pointing after its rotation, it will then fly along its new transformed z direction. like an airplane..
i cant seem to get this to work..
any ideas all?
|
|
|
|
|