OgreNewt - Newton makes friends with Ogre

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

Moderator: Alain

OgreNewt - Newton makes friends with Ogre

Postby walaber » Sun May 08, 2005 11:42 pm

this is a thread for my library that connects the Ogre rendering engine with Newton. many of you already now about this / have used it, as it's been available for some time now. anyway, I've just released a new version with many more example programs, and some improvements to the library, so I thought I'd add a thread here.

DOWNLOAD LINK - .rar archive, approx. 1.5MB


Demo01_TheBasics
Image

Demo02_Joints
Image

Demo03_CollisionCallbacks
Image

Demo04_Raycasting
Image

Demo05_SimpleVehicle
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 walaber » Thu May 19, 2005 5:40 am

for those interested, I've finished updating the source for documentation... today I also added the buoyancy features of Newton into OgreNewt, and made a quick demo to show how to use it :D

click for larger image
Image

new version will be released after the next Newton patch.
:D :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 martinw » Wed Jun 01, 2005 5:43 pm

Hello walaber,

Great wrapper to Ogre BTW.

I have loads of questions, but will endevour to do some searches and tutorials before I bore you with too many. But here's a few.

Where can I get the buoyancy demo.

How would I make a piston (actuator) in Newton, slider ? I've created a slider joint, but it seems just to create a hovering object with no interaction with its parent, which hovers and slides also.

In the piston example how would I move the piston, can I apply a force to the rod inside it to move it ? How do I set the limits of motion ?

Can joints be placed at bones, i.e. import a model with a bone structure and add Newton joints in the code, so as not to have to create lots of seperate mesh files.

Can a parent have multiple childs attached to the same joint ? Can a child have multiple parents ?

OK that's a lot of questions I know but I'm very excited about OgreNewt.

Thanks.

Martin
User avatar
martinw
 
Posts: 30
Joined: Wed Jun 01, 2005 1:19 pm
Location: Aberdeenshire

Postby walaber » Thu Jun 02, 2005 6:58 am

the buoyancy demo will be in the next release, which will be after the next Newton patch.

as for joints, you cannot attach more than 2 bodies to a single joint... and for making pistons, etc.. look at the Newton documentation, and the wiki about the joints... OgreNewt joints are handled the same as in Newton, by making callbacks that you can use to animate/limit them.

I agree I should make a more detailed demo of the joints in the future tho.
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 martinw » Thu Jun 02, 2005 8:49 am

Hello walaber,

Thanks for the reply.

The OgreNewt stuff is loadsa fun :D

With the buoyancy interface, do you think it would be possible to use a propeller to generate force ??

Martin
User avatar
martinw
 
Posts: 30
Joined: Wed Jun 01, 2005 1:19 pm
Location: Aberdeenshire

Postby walaber » Fri Jun 03, 2005 11:34 pm

I'm not sure what you want to do, but yes, I think the buoyancy system can be used to simulate moving air, etc...
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 Aug 11, 2005 12:20 pm

Seems that some of the media is missing in your archive:
For example:

Description: ../../media/packs/dragon.zip - error whilst opening archive: Unable to read zip file..

I also created an empty library: Programs etc.
Still I cant get the 1'st and 2'nd demo up and running due to this.
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby kjelle69 » Thu Aug 11, 2005 12:23 pm

Okok Found the media in the OgreSDK media library :oops:
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby kjelle69 » Thu Aug 11, 2005 2:35 pm

I have now managed to create another conveyor belt object, remade the box objects that is transported on the belts and everything works ! And I think I get at least a sligt idea of how things works.

But one thing I dont get is how you get the texture of the belt to move ?! My new belt is all white. :shock:
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby kjelle69 » Thu Aug 11, 2005 2:50 pm

Ok, somehow the texture is linked to the name, eg. :ConveyorBelt2 How ?
Somewhere in the Ogre definitions there are links to conveyor 1 and 2

Ogre::Entity* ent = mSceneMgr->createEntity(name, "box.mesh");
ent->setMaterialName(name);
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby kjelle69 » Thu Aug 11, 2005 2:52 pm

Haha !!

Got it !!!

material ConveyorBelt1
{
technique
{
pass
{

texture_unit
{
scroll_anim 0.105 0
texture conveyor.png
}
}
}
}

material ConveyorBelt2
{
technique
{
pass
{

texture_unit
{
scroll_anim -0.22 0
texture conveyor.png
}
}
}
}
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby walaber » Thu Aug 11, 2005 5:12 pm

sorry for not noticing all these posts, but it looks like you're figuring things out :P

and now you see why I switched from DBPro to Ogre w/ C++. the material system alone is worth it, not to mention everything else that is easer/better/more powerful :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 HopeDagger » Thu Aug 11, 2005 5:23 pm

Hey, walaber. I don't use OGRE myself (oldschool OpenGL'er :P), but the work that you've put in here is pretty clear, and from taking a look through the library and those samples, it's looks pretty dang cool!

Just handing out kudos where they are due. :)
HopeDagger
 
Posts: 1
Joined: Sat Mar 19, 2005 1:27 am

Postby kjelle69 » Fri Aug 12, 2005 7:01 pm

Trying to get the position of specific bodies: (Mixed c++ and pseudo code) Am I completely out in the blue here:

Code: Select all
for (OgreNewt::Body* me=1;me<=count;me++)
   {
      Ogre::Quaternion bodorient;
      Ogre::Vector3 bodpos;
      me->getPositionOrientation( bodorient, bodpos );
      if y of vector3 bodorient is less then -4 then
      {
         me->setPositionOrientation( Ogre::Quaternion(Ogre::Quaternion::IDENTITY), Ogre::Vector3(-3,3.5,0) );   
      }
   }
User avatar
kjelle69
 
Posts: 60
Joined: Fri Aug 27, 2004 9:08 am
Location: Koskullskulle, Sweden

Postby walaber » Fri Aug 12, 2005 9:30 pm

yeah, pretty close. might look something like this:
Code: Select all
for (OgreNewt::Body* me=1;me<=count;me++)
   {
      Ogre::Quaternion bodorient;
      Ogre::Vector3 bodpos;
      me->getPositionOrientation( bodorient, bodpos );
      if (bodpos.y < -4.0f)
      {
         me->setPositionOrientation( Ogre::Quaternion(Ogre::Quaternion::IDENTITY), Ogre::Vector3(-3,3.5,0) );   
      }
   }


except I'm not sure I understand your for() loop there... are you going to loop through all bodies in the world? if so using a body iterator would work better. I can explain it in OgreNewt if you want, it's really easy.
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

Next

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 20 guests

cron