Newton + Ogre

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

Moderator: Alain

Newton + Ogre

Postby walaber » Wed Oct 06, 2004 10:00 am

I got my first demo working with Ogre + Newton today...

the code is very sloppy, and I need to come up with a more OO-style solution, but I've got Newton and Ogre working together!!

Image
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 Cheery » Wed Oct 06, 2004 11:03 am

Good stuff but I didn't like from ogre...
User avatar
Cheery
 
Posts: 21
Joined: Sun Jul 11, 2004 1:47 pm

Postby cleathley » Wed Oct 06, 2004 11:57 am

looks good walaber..

very low frame rate for only 4000 polys though ...
User avatar
cleathley
 
Posts: 63
Joined: Sat May 22, 2004 12:19 am
Location: Perth, Australia

Postby walaber » Wed Oct 06, 2004 7:41 pm

yeah I was wondering about that too...

hopefully the difference between Debug and Release mode is big :lol: :lol:

also I have stencil shadows turned on in this demo.. without them the framerate is nearly double.

I'll keep messing around with Ogre, and see if I can make something worth releasing!
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 kjelle69 » Thu Oct 07, 2004 9:48 am

Totally stupid noob question..

What is Ogre ? Besides a green big fella ?
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby walaber » Thu Oct 07, 2004 10:17 am

OGRE is an open-source C++ 3D graphics engine.

I finally got around to compiling in Release mode, and the program runs much faster!! I as getting about 2x the framerate, with stencil shadows on for all objects. :D

now I need to think of how to properly incorporate Newton into the Ogre system!

but in the meantime I need to finish me Newton -based entry for the TGC game competition... it's very ragdoll-heavy :D
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 kjelle69 » Fri Oct 08, 2004 4:45 am

I sincerely hope that you wont stop producing the Wrapper for DBPro, that would make ... me... very saad... :cry:
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby walaber » Fri Oct 08, 2004 5:58 am

no, I'll keep updating the DBPro wrapper (and using DBPro myself)... but I also want to expand into full C++ game programming as well, and Ogre looks like the engine I'll be using for it :D
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 walaber » Fri Oct 08, 2004 8:21 am

I`ve updated the screenshot... you can see the fps is better now, with shadows on. my card is pretty slow with shadows, so overall I'm pretty impressed with OGRE so far :D
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 Van » Sun Nov 21, 2004 5:19 pm

walaber,

How did you pass the Ogre::Vector3 and Ogre:Matrix variables to newton? Can you show me a syntax. Its problably obvious and I will feel like a big ass when you show me. :oops:
Van
 
Posts: 17
Joined: Mon Nov 08, 2004 12:36 am

Postby walaber » Sun Nov 21, 2004 7:52 pm

Here's 2 helper functions that I use for passing matrices to and from Ogre:

Code: Select all
/*
NEWTON STYLE MATRIX:

[00][01][02][03]
[04][05][06][07]
[08][09][10][11]
[12][13][14][15]


OGRE STYLE MATRIX:

[00][04][08][12]
[01][05][09][13]
[02][06][10][14]
[03][07][11][15]
*/
#include "Ogre.h"


using namespace Ogre;

namespace OgreNewton
{

   // Take a Newton matrix and create a Quaternion + Position_vector
   void MatrixToQuatPos( const float* matrix, Quaternion& quat, Vector3 &pos )
   {
      // this takes a matrix returned by Newton, and creates a Quaternion
      // and position Vector3, which is more meaningful for Ogre.
      quat = Quaternion( Matrix3(   matrix[0], matrix[4], matrix[8],
                  matrix[1], matrix[5], matrix[9],
                  matrix[2], matrix[6], matrix[10] ) );
   
      pos = Vector3( matrix[12], matrix[13], matrix[14] );
   }

   // Take a Quaternion and Position Matrix and create a Newton-happy float matrix!
   void QuatPosToMatrix( const Quaternion& quat, const Vector3 &pos, float* matrix )
   {
      // this takes a Quaternion and a Vector3 and creates a float array
      // which is more meaningful to Newton.
      Matrix3 rot;
      Vector3 xcol, ycol, zcol;
      
      quat.ToRotationMatrix( rot );   // creates a 3x3 rotation matrix from the Quaternion.

      xcol = rot.GetColumn(0);
      ycol = rot.GetColumn(1);
      zcol = rot.GetColumn(2);
   
      // now fill the final matrix with the appropriate data:
      matrix[0] = xcol.x;
      matrix[1] = xcol.y;
      matrix[2] = xcol.z;
      matrix[3] = 0.0f;
   
      matrix[4] = ycol.x;
      matrix[5] = ycol.y;
      matrix[6] = ycol.z;
      matrix[7] = 0.0f;
   
      matrix[8] = zcol.x;
      matrix[9] = zcol.y;
      matrix[10] = zcol.z;
      matrix[13] = 0.0f;
   
      matrix[12] = pos.x;
      matrix[13] = pos.y;
      matrix[14] = pos.z;
      matrix[15] = 1.0;
   }



}   // end namespace OgreNewton
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 Cheery » Mon Nov 22, 2004 4:58 am

Ogre is stupid thing because it makes all so hard without proper reason. It contains useful stuff but most of that I can do myself in no time with openGL using my own methods.

My game engine is OOP also but it works triple better than ogre for me. No unneeded nodes into places where I don't need them! :wink:
User avatar
Cheery
 
Posts: 21
Joined: Sun Jul 11, 2004 1:47 pm

Postby Kanda » Tue Nov 23, 2004 10:06 am

An alternate free engine could be :
www.kjApi.com

Newton is being integrated in a world editor of this engine (the tool will be availabe very soon).
Kanda
 
Posts: 1
Joined: Tue Nov 23, 2004 9:08 am
Location: Gamee Dev

Postby walaber » Tue Nov 23, 2004 7:46 pm

kjApi looks pretty impressive...

I don't have C#, so Axiom isn't really an option...
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 monster » Tue Nov 23, 2004 8:24 pm

There's a handy database of 3D engines on DevMaster.net;
http://www.devmaster.net/engines/

@ walaber
I'm looking forward to seeing Newton 1.30 integrated with Ogre 0.15!
User avatar
monster
 
Posts: 9
Joined: Tue Apr 13, 2004 9:58 pm
Location: Melbourne, Australia

Next

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 12 guests

cron