Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
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   
Pages: [1]
  ignore  |  Print  
  [OdeJava] Example with Xith - More simplistic  (Read 2297 times)
0 Members and 1 Guest are viewing this topic.
Offline sunsett

Senior Member




ribbit!


« Posted 2005-07-24 18:09:44 »

I apologize for having to ask this, but after taking a lot of time and learning Xith, which was relatively painless after going through the tutorials and playing around wth all the example code, I am trying to learn OdeJava to utilize the collision detection and physics but am having a difficult time as all the links to a tutorial are for the old version of the forum that no longer seems to exist anymore.  If someone could give me a bit of very simple sample code that simply creates two objects and applies the OdeJava physics and collision system to them it would be very useful to me, but would be very useful to a lot of other people I think as well.

I have gone through the Car example and there's just so much junk being referenced in so many different classes it's extremely difficult to put it all together and understand exactly what is happening.  I want just a single class that functionally applies physics and collision detection.  I'm assuming it's not that complicated for someone capable of doing it.  If this isn't true then perhaps I should be writing my own physics and collision system instead of using Ode.

Finally, a lot of the sample code I've seen in the forums are not actually even functional, they reference object names of things that I'm assuming used to exist but no longer do.

Thank you,

Matthew D. Hicks
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #1 - Posted 2005-07-24 22:03:28 »

http://odejava.org/showsrc.php?src=src/org/odejava/test/simple/HighLevelApiExample.java
Offline sunsett

Senior Member




ribbit!


« Reply #2 - Posted 2005-07-24 23:58:34 »

NewbTon,

I took a look at that one already, I guess I need to look at it further, but it doesn't show anything graphically for me.  It just steps through and then exits.  I'll look at the way the code works though and hopefully be able to figure out how to apply this.

Thanks,

Matt
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #3 - Posted 2005-07-25 00:51:52 »

Theres nothing  "graphically"  in ODE. You create your bodies and geometry,
read their positions during steps, then copy the values over to their graphical counterpart which can be anything.
Once you understand ODE which is not very difficult you will understand what I mean.


Offline sunsett

Senior Member




ribbit!


« Reply #4 - Posted 2005-07-28 03:50:22 »

Well, I've been looking at the sample code some more and it looks like there are two ways to work with Ode and Xith.  Either build your Xith scene and generate Ode objects based on them, or generate your Ode objects and generate your Xith scene from it.  My question is, which way is the better way to go?

Thanks
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #5 - Posted 2005-07-28 05:04:46 »

Generate ODE objects and create your XIth objects from them
Personally I have an object that binds those two, something like :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
interface INode {
  public void setPosition();
  public void setRotation();
 }

Class OdeNode {
   INode node;//could be anything
  Body body; //ode
public void update() {
    node.setPosition(body.getPosition());
    node.setRotation(body.getRotation());
   }
}

Just make different implementations of INode and your ODE specific code will never be mixed up with your rendering code.
So if you want to switch to some other rendering API you can do it in 10 minutes (or in a matter of days still its very fast)

Offline sunsett

Senior Member




ribbit!


« Reply #6 - Posted 2005-07-28 22:34:28 »

I appreciate all your advice, I was thinking about doing that actually.  I don't suppose your code is available so I can get some ideas of how to best implement this?

In fact, drop me an e-mail if you'd be interested in possibly working on some projects together: darkfrog@pyramex.com

Thanks,

Matt
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #7 - Posted 2005-07-29 01:37:38 »

Hey Sunsett right now I dont have much time other than for my own little project. but maybe later on.
There's so much to do on that I just can't do anything else.
If you looked at my code right now it would probably confuse you totally it still  confuses me  !
The basic idea is what I wrote before. And to make it easier on yourself abstract everything that has to do
with graphics.
I dont understand why you dont see many doing that since all scenegraphs basically have the same interface.

Offline sunsett

Senior Member




ribbit!


« Reply #8 - Posted 2005-07-30 02:03:28 »

Perhaps I could be of some assistance?  If you're not looking for any help I understand, but I'm a professional Java developer that's trying to pick up game development and I'm having a difficult time.  I'm a very good coder though.  I was just thinking that I might be able to help you with your project and in turn you might help me smooth to path to learning 3d game design.

Either way I appreciate your willingness to help.  For anyone else that is having the same problems I've been having, I've attached an example source that combines the Ode and Xith code into one class for the "SimpleExample" / "HighLevelApiExample".  I've found this very beneficial to understanding how they work together and thought it could be beneficial.  I've commented which sections go to which technology.

You'll also need the "groundandtrees3.png" file that is included in the OdeJava download.  You'll just have to put that in your default directory or register another Texture path.

Thanks,

Matt
Offline sunsett

Senior Member




ribbit!


« Reply #9 - Posted 2005-07-30 13:13:19 »

Something else I'm not quite sure how I would do in Ode.  I'm using ASE models in my project and I would like to add collision detection and physics to them, but not sure how I would do that from Ode?  Is this one case where it makes more sense to build my Xith object and then determine the bounding sphere around it and define that for Ode?

Thanks,

Matt
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline m_ali_alex

Senior Newbie





« Reply #10 - Posted 2006-01-11 20:28:36 »

hi Matt

thanks  a lot for your help
however i got an error when i tried to compile your attached file
here is the error
C:\Documents and Settings\mali\Desktop\New Folder\CopyOfOde2XithTest2.java:114: cannot resolve symbol
symbol  : variable TestUtils
location: class CopyOfOde2XithTest2
        geom = TestUtils.createQuad(
               ^
1 error

Tool completed with exit code 1
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.

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

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

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

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

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

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

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

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

Rayexar (72 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!