Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Posted
2003-12-12 05:23:45 » |
|
I have started this thread for Odejava beginners. If you have any questions on how to get started with Odejava then post your message here. In here you can ask e.g. how to create various objects, create fixed enviromental objects (e.g. racing track with ramps), or how to attach an box into a sphere with a joint (e.g. car chassis with 2-axis joint on wheels) and so on. Currently best source for getting started with Odejava is package net.java.dev.odejava.test. Simplest scenario is OdeHelloWorld.java. Binding odejava's objects into 3d renderer is simple. Check e.g. package net.java.dev.odejava.jme.test. There is a BoxApp.java class that constantly reads translation and rotation information for each object from OdeBox.java class and updates this information to jME objects before rendering the scene. http://odejava.dev.java.net has a package called odejava-0.1.1-full.zip, all sources included.
|
|
|
|
|
Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Reply #1 - Posted
2003-12-14 17:44:43 » |
|
I'll be adding few simpler demos later showing how to implement a specific physic setup with odejava. Something as simple as getting started tutorials with Xith3d. E.g. how to create simple objects, static objects, how to use various joints, how to apply forces to an object and finally how to bind ode objects to your 3d library (xith3d, jme, openmind etc.). What do you think, these are pretty simple but might help the understanding of Odejava at first glance, how important is this?
In the meantime you can ask your question here (or by writing email to me).
Please suggest demos than should be added to the getting started section or other ideas that you might have. Java API itself is ready but there's always room for making it better.
PS. New package and CVS will be released in a couple days.
|
|
|
|
|
William Denniss
|
 |
«
Reply #2 - Posted
2003-12-18 02:20:37 » |
|
an Ode getting started guide for Xith3D would be very good indeed.
How is ode at handling terrain? I currently generate terrain using a random fractal generator (essentially just making quads) and I am woundering how hard it would be to integrate it with ode and a vehicle.
Thanks,
Will.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Reply #3 - Posted
2003-12-20 10:22:05 » |
|
Terrain is added to Odejava 0.2 along with nicer API also.
Terrain is basically defined by heights and length. If you want to check how it is implemented then see ode/contrib/TerrainAndCone/readme.txt
I am sure it works with Odejava also but rendering the terrain needs to be done. it would be excellent if you can write an Xith3d routine that draws the terrain, see ode/contrib/TerrainAndCone/readme.txt and see the method dsDrawTerrain. Should not be too complicated, the routine just draws filled triangles with couple lines of code. I try to concentrate on releasing the new version, contact me if you need help with this one!
Trying to release version 0.2 this weekend.
|
|
|
|
|
Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Reply #4 - Posted
2003-12-20 10:45:06 » |
|
Here's how you create terrain on Odejava 0.2.
--- int terrainNodes = 4; float[] heights = new float[terrainNodes* terrainNodes]; float length = 4f; float height = 0.5f; int numNodesPerSide = 4; for (int i=0;i<terrainNodes* terrainNodes;i++) heights = height * (float) Math.random(); GeometryTerrain terrain = new GeometryTerrain(space, heights, length, numNodesPerSide); ---
Please write to me if anyone wishes to create Xith3d routine that renders this terrain. I think this is pretty easy for anyone that is familiar with 3d.
In practise the routine below needs to be made with Java.
--- void dsDrawTerrain(int x,int y,float vLength,float vNodeLength,int nNumNodesPerSide,float *pHeights) { float A[3],B[3],C[3],D[3]; float R[12]; memset(R,0,sizeof(R)); R[0] = 1.f; R[5] = 1.f; R[10] = 1.f; float pos[3]; pos[0] = pos[1] = pos[2] = 0.f; float vx,vy; vx = vLength * x; vy = vLength * y; int i; for (i=0;i<nNumNodesPerSide;i++) { for (int j=0;j<nNumNodesPerSide;j++) { A[0] = i * vNodeLength + vx; A[1] = j * vNodeLength + vy; A[2] = GetHeight(i,j,nNumNodesPerSide,pHeights); B[0] = (i+1) * vNodeLength + vx; B[1] = j * vNodeLength + vy; B[2] = GetHeight(i+1,j,nNumNodesPerSide,pHeights); C[0] = i * vNodeLength + vx; C[1] = (j+1) * vNodeLength + vy; C[2] = GetHeight(i,j+1,nNumNodesPerSide,pHeights); D[0] = (i+1) * vNodeLength + vx; D[1] = (j+1) * vNodeLength + vy; D[2] = GetHeight(i+1,j+1,nNumNodesPerSide,pHeights); dsDrawTriangle(pos,R,C,A,B,1); dsDrawTriangle(pos,R,D,C,B,1); } } } ---
|
|
|
|
|
|
|
Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Reply #6 - Posted
2003-12-21 11:55:10 » |
|
Thanks for the tip, I'm busy gettin odejava 0.2 out and setting up the CVS. Low level API is now fully supported through ODE C API, high level API is almost finished after this is done I'll release 0.2.
PS. It supports TriMesh and also some contrib sections like Terrain, Cone and Cylinder.
|
|
|
|
|
William Denniss
|
 |
«
Reply #7 - Posted
2003-12-21 22:23:31 » |
|
Just incase anyone else is following this thread (Jani has already been emailed the code) - the Xith3D method to build the terrain from a heightmap is finished - I'm releasing the code along side some other handy modular 3D related stuff in a small library named "Enviro3D (e3d.jar)". I'll bung it in the xith-tk projects cvs in due course.
Also included will be a random fractal terrain generator which I ported from C.
Will.
|
|
|
|
Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Reply #8 - Posted
2003-12-22 06:29:55 » |
|
Hope you get to try odejava.org.geom.GeomTriMesh also  Terrain works nicely on Odejava 0.2 but rendering has still some issues, surely William can fix them.
|
|
|
|
|
Jens
|
 |
«
Reply #9 - Posted
2003-12-22 11:08:49 » |
|
I'm really looking forward to the next ODE release and the Xith3D terrain stuff sounds very interesting, too.  Please don't keep these things to yourselves. Get them out, soon. 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
William Denniss
|
 |
«
Reply #10 - Posted
2003-12-23 08:02:02 » |
|
update: I think I've fixed the terrain problemo. The new high-level ode objects are most convenient. It'll be good when its in CVS (hopefully this will be soon)  Will.
|
|
|
|
Jani Laakso
Junior Member  
Do it with Java!
|
 |
«
Reply #11 - Posted
2003-12-23 11:04:05 » |
|
Odejava 0.2 is going to CVS now.. It should be there in half an hour or so.
|
|
|
|
|
otelo
|
 |
«
Reply #12 - Posted
2006-03-08 13:03:13 » |
|
Thanks for the tip, I'm busy gettin odejava 0.2 out and setting up the CVS. Low level API is now fully supported through ODE C API, high level API is almost finished after this is done I'll release 0.2.
PS. It supports TriMesh and also some contrib sections like Terrain, Cone and Cylinder.
It's been more than two years, but GeomCone support is still missing. Am I overlooking something? Is it even in the native library ?
|
|
|
|
|
NewbTon
Junior Member  
Odejava games rock!
|
 |
«
Reply #13 - Posted
2006-03-08 15:27:05 » |
|
Damn I read this entire thread before I found out it was from 2003 
|
|
|
|
|
Amos Wenger
|
 |
«
Reply #14 - Posted
2006-03-08 17:22:45 » |
|
|
"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
|
|
|
|
|
PeteTheNotSoGr8
Junior Newbie
|
 |
«
Reply #16 - Posted
2006-04-28 16:33:24 » |
|
In the most recent documentation it says that the terrain call has been disabled. Is this actually the case? If so does anyone know why?
In case I can't use the preprogrammed terrain generator, what is an appropriate size for the triangles in a GeomTriMesh that is serving for the terrain. My current count takes to long to run through and I run into timing issues with other threads starting their shit before I am ready for that to happen.
BTW I am doing fractal terrain based on the Diamond-Star method, if that helps find a solution.
Thanx for any help you can give me.
|
|
|
|
|
William Denniss
|
 |
«
Reply #17 - Posted
2006-04-29 05:21:51 » |
|
I also implemented fractal based terrain, and used GeomTriMesh's. The Terrain thing was a patch to ODE that was not commented or documented and didn't work. GeomTriMesh is a more generic case, but should work well for terrain.
Will.
|
|
|
|
Amos Wenger
|
 |
«
Reply #18 - Posted
2006-04-29 12:02:25 » |
|
I also implemented fractal based terrain, and used GeomTriMesh's. The Terrain thing was a patch to ODE that was not commented or documented and didn't work. GeomTriMesh is a more generic case, but should work well for terrain.
I had bad experiences on this one.. Objects falling through the terrain, and other bugs like that..
|
"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
|
|
|
PeteTheNotSoGr8
Junior Newbie
|
 |
«
Reply #19 - Posted
2006-05-05 16:37:36 » |
|
William Denniss, Could you post a link to the source code for your terrain. I seem to have everything working but it just won't pick up the collision with the surface. The exact same code works with the GeomPlain terrain, pretty well but I just can't make it go for that third dimension.
|
|
|
|
|
horizon_w
Junior Newbie
|
 |
«
Reply #20 - Posted
2006-05-17 04:26:35 » |
|
I'm the beginnner of ODEjava. I found the resources have little difference between the CVS and odejava.org----there have different jar files. I choose to run the code from the odejava.org on the netbean, they have been compiled correctly, but when I choose to run a project of odejava ,I saw nothing! even the sample. Can u help me to slove that? I found the my package strcture are not as same as what have been mentioned above.
|
|
|
|
|
|