Newton + Ogre

Share with us how are you using the powerrrr of the force

Moderator: Alain

Postby SnprBoB86 » Wed Feb 02, 2005 1:36 pm

SnprBoB86
 
Posts: 26
Joined: Mon Jan 24, 2005 5:53 pm

Postby walaber » Wed Feb 02, 2005 10:24 pm

indeed, I figured instead of writing a parser, I might as well use an established format, that is easy to adjust by hand (for tweaking/testing/etc)...

and the TinyXML library seems really simple and easy to use, so I decided to go with that format... (partly as a learning experience as well).
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Postby Julio Jerez » Wed Feb 02, 2005 11:23 pm

I will check that tinyXML then.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby monster » Wed Feb 02, 2005 11:29 pm

Also, if you write a DTD and use a validating parser (like Xerces) then you can make sure the input XML conforms to the standards you define without having to write complex parsers yourself.
User avatar
monster
 
Posts: 9
Joined: Tue Apr 13, 2004 9:58 pm
Location: Melbourne, Australia

Postby walaber » Thu Feb 03, 2005 2:55 am

lots of progress on my Rigid Body Designer...

last night I finally go convex hulls working- when you add a convex hull, it asks you for a mesh file. then it runs it through the Newton system, generating a convex hull. then I make a new visual shape from the Newton convex hull, and use that as the visual representation of the hull. this way the user can see EXACTLY how Newton will create the convex hull.

then, when the rigid body is saved to XML, it saves the vertices for the convex hull right into the file (post-processed, so only the necessary vertices are saved), so it doesn't need the mesh used to generate the hull.

here's a screenshot of my Mustang model, and the generated hull:
Image

and here's an example of what the XML file looks like when created:
Code: Select all
<?xml version="1.0" ?>
<!--Rigid Body file, created by Rigid Body Designer-->
<rigid_body name="test for now">
    <mesh filename="mustang.mesh" />
    <properties mass="100" inertia="1 1 1" />
    <primitive name="hull" shape="convex_hull">
        <properties position="0 0.9 -1.7" rotation="0 0 0">
            <vertex pos="0.67536 0.0540575 -0.741469" />
            <vertex pos="1.31233 -0.0647717 -0.704744" />
            <vertex pos="0.635047 -0.143179 -0.705694" />
            <vertex pos="0.67536 0.0540575 -0.741469" />
            <vertex pos="1.16511 0.125647 -0.743052" />
            <vertex pos="1.31233 -0.0647717 -0.704744" />
      (...vertices continue....)
            <vertex pos="-0.0227959 0.789922 0.36187" />
            <vertex pos="0.398329 0.785539 0.36187" />
            <vertex pos="0.401449 0.810376 0.240613" />
            <vertex pos="-0.0351537 0.814759 0.240613" />
            <vertex pos="-0.0227959 0.789922 0.36187" />
        </properties>
    </primitive>
    <primitive name="box" shape="box">
        <properties position="-1.2 0 0" rotation="0 0 57.2957" size="1 1.7 1" />
    </primitive>
    <primitive name="cap1" shape="capsule">
        <properties position="0.75 0 0" rotation="0 0 0" height="2.65" radius="0.5" />
    </primitive>
</rigid_body>


today was my first day using TinyXML, but it's working great, really straightforward and easy to use. I pretty much have the save routine complete, now I need to implement loading. shouldn't be too much trouble.
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Postby _Tux_ » Thu Feb 03, 2005 5:36 am

does anyone know a good XML parser for delphi?
_Tux_
 
Posts: 81
Joined: Wed Sep 08, 2004 10:38 am
Location: UK

Postby rswm » Thu Feb 03, 2005 7:03 pm

@tux : thaxml
"You will never know everything - but it's good to know where to ask for !!!" *g*

My Project : JS Install Suite - i'm looking for someone who will continue it !!!!
rswm
 
Posts: 2
Joined: Fri Jan 07, 2005 6:56 am
Location: Chemnitz, Germany

Postby Slick » Thu Feb 03, 2005 10:53 pm

Is the plan with a convex hull to use it instead a bunch of primitives?
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Postby The unProfessional » Thu Feb 03, 2005 11:05 pm

For convex primitives, yep... we could just have helper functions (provided by users) in order to build convex hulls of any primitives not supplied by newton.
The unProfessional
 
Posts: 131
Joined: Sun May 02, 2004 9:08 pm
Location: Southern California

Postby walaber » Fri Feb 04, 2005 3:35 am

if you have a relatively convex shaped object, convex hulls are a quick way to get accurate collision without using primitives... but for more complex objects, it's best to use a combination of several primitives (or several convex hulls)... hence the need for an editor like the one I'm making.
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Postby _Tux_ » Fri Feb 04, 2005 5:15 am

rswm wrote:@tux : thaxml


excellent :)
_Tux_
 
Posts: 81
Joined: Wed Sep 08, 2004 10:38 am
Location: UK

Postby walaber » Mon Feb 07, 2005 5:42 am

quick little video from me testing out one of my jump models :)

JUMP THE CABRIO
Independent game developer of (mostly) physics-based games. Creator of "JellyCar" and lead designer of "Where's My Water?"
User avatar
walaber
Moderator
Moderator
 
Posts: 393
Joined: Wed Mar 17, 2004 3:40 am
Location: California, USA

Postby Julio Jerez » Tue Feb 08, 2005 12:55 am

Hey walaber what codedec is the avi using, when I clip window media it says it does not recognizes the file.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Postby The unProfessional » Tue Feb 08, 2005 4:18 am

Once again, walaber, you apply newton very nicely. It looks and feels great.

Here's Walaber's video re-encoded with divx5: http://www.sonicubegames.com/downloads/jump1_divx5.avi[/url]
The unProfessional
 
Posts: 131
Joined: Sun May 02, 2004 9:08 pm
Location: Southern California

Postby Xpoint » Tue Feb 08, 2005 8:07 am

Very nice video :D
little question: how did u make that video? :)
User avatar
Xpoint
 
Posts: 71
Joined: Wed May 26, 2004 5:41 pm
Location: Netherlands

PreviousNext

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 9 guests

cron