Page 2 of 17

Posted: Fri Jun 04, 2004 9:14 am
by monster
Crappy code notwithstanding, here's the new "chain" test. In this version (as opposed to the ODE version) you can throw the chain around manually and freeze it in mid-air in a Matrix bullet-time stylee;
Image

Posted: Fri Jun 04, 2004 9:23 am
by houssem_bdioui
Great monster :

Would be nice if you succeed to use real chain links, as in the Novodex
demos : http://www.novodex.com/demos.html

Posted: Fri Jun 04, 2004 9:43 am
by monster
Well, the mesh that each "link" in the chain uses can be anything you want. I just used spheres 'cos that's what the ODE demo that I'm re-implementing uses.

Posted: Fri Jun 04, 2004 10:04 am
by houssem_bdioui
monster wrote:Well, the mesh that each "link" in the chain uses can be anything you want. I just used spheres 'cos that's what the ODE demo that I'm re-implementing uses.
Don't think it's the same since you are using some joints to link your spheres while using "links" only envolves contact joints : so it's more natural let's say.

Posted: Fri Jun 04, 2004 10:09 am
by tuan kuranes
Impressive Work ! Bravo !

Once finished, Ode people will have to drop their "drawlib" thing ! ;) [edited]

As we're on Ode things, here's an two interesting snippets of code with binary win demos at http://www.geocities.com/stuart_gooding/ :

- GLodemanager : sort of odecppp + refapp (collision, friction, behaviours)
- SMCEditor : impressive editor taking animated body and set updating geoms around each bone during animation. (could be use with ODE or verlet phys.)

(beware delphi inside... but not so far from cpp code readings.)

Posted: Fri Jun 04, 2004 11:18 am
by psyclonist
Good work! Quite a few people will find this very useful!
tuan kuranes wrote:Once finished, Ode people will have to drop their "drawlib" thing !
I don't think this would be a good thing ;) (not to speak of the previous attempts to replace or enhance drawlib...)

Anyway, drawlib exists only for the samples that ship with ODE. It's not intended to be used in any other applications. It'd be crazy to replace it and introduce another dependency. (ODE doesn't need eye candy ;) )

-psy

Posted: Fri Jun 04, 2004 11:36 am
by monster
Don't think it's the same since you are using some joints to link your spheres while using "links" only envolves contact joints : so it's more natural let's say.
Ah, fair enough. I haven't looked at the Novodex samples much. However, as I've said before these tests are really just re-implementations of the ODE tests to make sure my framework isn't doing anything stupid and to try to get it tuned to work with real-world values.

Plus, in any reasonably complex game situation I would argue that there's absolutely no way you'd want to model chains in Novodex's "real world" way since that would be far, far too computationally expensive.
I don't think this [dropping drawstuff] would be a good thing
I totally agree with psy on that one, but I'm sure you were just being ironic anyway.

The drawstuff library is just a teeny tiny graphical framework for visually testing ODE. There's no way you'd use it in a production application, just like you wouldn't use Ogre's ExampleApplication or ExampleFrameListener, and people who are just after a physics engine wouldn't want several megs worth of graphics library!

Ogre is completely separate from ODE, as it should be, and OgreOde is (spookily enough) positioned to be the glue between the two. Just like Ogre, OgreTok, and Tokamak in fact! But then I'm sure you already knew that!
;)

Posted: Fri Jun 04, 2004 1:30 pm
by sinbad
Would you be interested in putting this in ogreaddons so it can jostle boistrously with OgreTok ? ;)

Posted: Fri Jun 04, 2004 1:39 pm
by tintin
I'm interested in the lighting in that scene.

You seem to have a perfect light "cone" with speculat light on the right side. What are your light values, and how is that floor surface made up.

When I have one ground mesh and one point light, I can only get the whole mesh to either be fully lit or not lit at all, with no specualr, no matter what settings i use

Posted: Fri Jun 04, 2004 4:01 pm
by monster
@ sinbad
For sure, but it'll probably be a while before it's ready. I'm always up for a bit of boistrous jostling.
:?
(where's your other hand? between two pillows. those aren't pillows! etc...)

@ tintin
It's just a spotlight. The ground mesh is just a bunch of simple flat meshes, each one 20x20 units (in my case 20x20 meters) and 5x5 quads (i.e. 50 tris). The more polys you have the better the edge of the spot lit area is, so really I should have high-poly version in the middle and lower LODs further out where it's dark and no-one ever goes! But it is just a demo to test my wrapper.

To get specular lighting I just set a specular component on my light and in my material. That works even if my mesh is 1000x1000 and 2 tris. It doesn't work in OpenGL though, only DirectX.

Posted: Fri Jun 04, 2004 5:03 pm
by ggambett
monster wrote:To get specular lighting I just set a specular component on my light and in my material. That works even if my mesh is 1000x1000 and 2 tris. It doesn't work in OpenGL though, only DirectX.
Why? To get specular highlights in huge triangles you need some kind of per pixel lighting, which OpenGL supports - maybe it's a problem with your drivers?

Posted: Fri Jun 04, 2004 6:13 pm
by monster
Why? To get specular highlights in huge triangles you need some kind of per pixel lighting, which OpenGL supports - maybe it's a problem with your drivers?
Dunno. I've just never got specular lighting (with the fixed function pipline) under OpenGL (with Ogre). Makes no difference whether it's huge triangles or small ones. Here's two shots takes from exactly (give or take a few pixels) the same position in my OgreOde test app, with exactly the same code. One under OpenGL, one under DX9, the only difference is what I chose in the Ogre config dialog. That's on a GeForce FX5600 with the 56.72 drivers.
Top one's DX9, bottom one's OpenGL;
Image
Image
And, while we're on the subject of OpenGL being bonkers. Modulative texture shadows. Crayzzeee!
Image
In case you're wondering, the shadows seem to be OK on the mesh that's under the spotlight casting them, but they're repeated across every mesh in the scene. And when the casting object(s) moves off that mesh then the shadows don't get cast any more. They fade out in the very very far distance, rather than in accordance with the spotlight settings. That's using the Octree scene manager. Works fine under DX9.

Posted: Fri Jun 04, 2004 6:36 pm
by monster
Oh, and just so DirectX doesn't feel left out; texture shadows sometimes cause horrible stuttering under DirectX in Release mode. If I turn off shadows (I can flip them on and off dynamically in my test app) then the stuttering goes away, or if I switch to OpenGL (although I do get the bonkers effect from above), or if I run under DirectX in debug mode (and that's not the debug version of DirectX, just of Ogre and my app), I don't get the stuttering. Or even sometimes I don't even get it under DirectX!

Hang on, all of this graphical cobblers has nothing to do with physics! I've hijacked my own thread here.
D'oh!

Posted: Sat Jun 05, 2004 1:34 am
by KeaponLaffin
monster wrote:Hang on, all of this graphical cobblers has nothing to do with physics! I've hijacked my own thread here.
D'oh!
LOL! :lol:

This is looking great, I can't wait to see it in the add-ons. (applauds like a maniac)

Posted: Sat Jun 05, 2004 8:05 am
by monster
Test trimesh, seems to have some problems colliding capsules.
Could be something to do with small triangles, or high gravity.
Or something.
Image

Posted: Sat Jun 05, 2004 8:40 am
by Noiprox
:shock: :mrgreen: :shock:

Nice. Keep up the good work!

Posted: Sat Jun 05, 2004 12:57 pm
by sinbad
As for the GL texture shadows, there's a GL transform state bug (I really don't like GL's stateful transform pipeline - too open to bugs like this..) hidden somewhere in there which I managed to create once, but never managed to create again - it just went away (always concerning). Obviously it's still there - when your code is ready for ogreaddoning I'll see if I can recreate it with that.

I've no idea what the stuttering is about, never seen it!

And I'm amazed that DX gives you a per-pixel specular effect when you use large tris. It shouldn't, in truth, since specular terms are only supposed to be calculated at vertices. :?

Posted: Sun Jun 06, 2004 9:16 am
by bad_camel
Sheesh, so all this time it was a bug. I really thought I was being a tit, so I didn't bother asking...was gonna leave it till the "make it look pretty stage". Good to know :)

Posted: Sun Jun 06, 2004 12:37 pm
by monster
It just does something like this;

Code: Select all

// Use a load of meshes to represent the floor
int i = 0;
for(Real z = -80.0;z <= 80.0;z += 20.0)
{
    for(Real x = -80.0;x <= 80.0;x += 20.0)
    {
        Entity* mPlane = mSceneMgr->createEntity(String("Plane_") + StringConverter::toString(i++), "Plane.mesh");
        mPlane->setCastShadows(false);
			
        SceneNode* mPlaneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
        mPlaneNode->attachObject(mPlane);
        mPlaneNode->setPosition(x,0,z);
    }
}
Where "plane.mesh" is a 20x20 unit grid of 50 triangles (i.e. 25 quads, 4x4 units, 5 on a side, if you see what I mean).

[edit]...same sort of thing happens on the Trimesh demo (last picture posted) under OpenGL; the shadows are cast on the "terrain" mesh as if it hasn't been transformed. It's just moved by (0,3,0) and it's the only entity in the scene using that mesh.[/edit]

Posted: Tue Jun 08, 2004 4:11 pm
by monster
Test Crash, now with added Helicopters;
Image
(click for the less atmospheric version)

Posted: Tue Jun 08, 2004 4:27 pm
by houssem_bdioui
Really good work monster.

And what is the mission of this helicopter ? :)

Is the helicopter's body a trimesh or just a box?

Posted: Tue Jun 08, 2004 5:55 pm
by SpannerMan
Wow! I cant wait to check this out in action. What sort of framerates are you getting, especially for that particular shot...thats alot of fallin boxes.

Posted: Tue Jun 08, 2004 9:23 pm
by sinbad
/me jumps up and down a lot

Looking sweet! :)

Posted: Tue Jun 08, 2004 10:45 pm
by supersuper
Beautiful (the helicopter one). :P

Posted: Tue Jun 08, 2004 11:36 pm
by 3rd eye brainworm
how is ode working with your buggy,

i hate it and im writing my own physics code,

but i didnt realy try ode

and i dont want to