Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to use newtons physics.

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 14th Jun 2008 20:41
I have downloaded newtons physics from-
http://www.newtondynamics.com/downloads.html#

I want to use it, mostly becaue it looks nice, but when I looked at the header file of how to use it, it was complicated.

Does anyone know of a turorial of how to use the physics? It can be in DPPro, DBBasic, or DGDK, or anyother c++ language, I just need a tutorial.

Thanks!

Your signature has been erased by a mod - 120 high maximum please
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 02:59
And, if anyone is willing to do this, can I see a code snippet of gravity at work? Where an object can go up and down a hill smoothly, without using dbGetTerrainHeight, but useing an imported 3D model?

Thanks.

What I mean by tutorial is anything that can help me figure out how to use newtons physics.

Your signature has been erased by a mod - 120 high maximum please
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 05:12
I was actually looking around, and i saw a thread that said to try Ageia PhysX. I have tried that before, and it looks really complex also.

It probably isn't, because before I only got as far as looking at all of the headers and libs, etc.

There are a lot of headers and libs, and I was wondering if anyone knew which ones i need to get gravity to work. From there, I think I can handel it.

Thanks.

Is physX better then newtons physics?

Your signature has been erased by a mod - 120 high maximum please
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 15th Jun 2008 13:38 Edited at: 15th Jun 2008 13:49
I downloaded it and looked at the tutorials... looks really good. I wouldnt use it as a game engine, but if I could combine some of that kinda stuff with DGDK it would be awesome. It also seems like the compiled exe files use some kind of runtime engine or launcher in the background (which sux). Its worth playing around with it to learn how to use it before trying to combine it with DGDK. I think one challenge would be to get it working with DGDK object ids.
Im no expert but I think it uses Open GL
// initialize Opengl
InitOpenGl (argc, argv, "Newton Tutotial 1: Getting Started", DrawScene);

Did you see Tutorial 6? With the tower kind of thing that you can mess up and throw all the little pieces of wood around anyway you want to..... Blows my newbie mind!!!
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 15:20
Quote: " I wouldnt use it as a game engine"


Why not? And also, which one are you talking about, ageia physx or newtons physics?

Quote: "Did you see Tutorial 6? With the tower kind of thing that you can mess up and throw all the little pieces of wood around anyway you want to..... Blows my newbie mind!!! "


They all were amazing! Blows my mind too. The on problem was that i had no idea what I am supposed to do because there are like NO TUTORIALS!!!!

Have you seen the header files, they are like crazy

Quote: "Im no expert but I think it uses Open GL
// initialize Opengl
InitOpenGl (argc, argv, "Newton Tutotial 1: Getting Started", DrawScene);
"


Yeah, I think that too....

Thanks!

Your signature has been erased by a mod - 120 high maximum please
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 15th Jun 2008 16:31 Edited at: 15th Jun 2008 16:37
I downloaded the one that said

Newton Game Dynamics SDK 1.53
For Win32
Simple physics engine

Quote: "I wouldnt use it as a game engine"


I guess I dont know enough about it to say that, but I am really loving DGDK right now. I cant find any help/reference files yet for newton but it seems to be way more complicated than DGDK. Im not to keen to learn a whole new way of doing things right now.

But it guess the real issue is how to use the physics with DGDK.

Quote: "And, if anyone is willing to do this, can I see a code snippet of gravity at work? Where an object can go up and down a hill smoothly, without using dbGetTerrainHeight, but useing an imported 3D model?"


Have you seen the Sliding demo that comes with the SC collision plug in? its only a few lines of code. It is great for collision/gravity. It works great with terrain also. I copied it and reused it in my game.




So your object will be group 0 and everything that is your level or terrain would be group 1. I can get you a better "working' example to copy if u want.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 16:36
Quote: "Have you seen the Sliding demo that comes with the SC collision plug in? its only a few lines of code. It is great for collision/gravity. It works great with terrain also. I copied it and reused it in my game. "


That works with gravity? Well, why didn't you say so!!!! Also, my demo doesn't work, I am not sure why, it just won't work.

Also, how smooth is it?

Quote: "I guess I dont know enough about it to say that, but I am really loving DGDK right now. I cant find any help/reference files yet for newton but it seems to be way more complicated than DGDK. Im not to keen to learn a whole new way of doing things right now.

But it guess the real issue is how to use the physics with DGDK. "


You are probably right about the game engine, I completely agree. I would like to use it with darkGDK though.

Thanks.

Your signature has been erased by a mod - 120 high maximum please
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 15th Jun 2008 17:09
here is a realy simple demo, dont know if it means anything

Attachments

Login to view attachments
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 15th Jun 2008 18:06 Edited at: 15th Jun 2008 18:06
implementing newton is not really something many beginners will want to be involved with. However for those who want to give it a go you can get a fair idea how to start by examining my newton source code which is in this post:

http://forum.thegamecreators.com/?m=forum_view&t=123933&b=22

Its old code and rather ugly and not nearly commented enough - but for the determined you might get something out of it

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 18:36
Quote: "implementing newton is not really something many beginners will want to be involved with. However for those who want to give it a go you can get a fair idea how to start by examining my newton source code which is in this post:"


Wow, that looked really hard... Thanks anyways.

Quote: "here is a realy simple demo, dont know if it means anything "


Thanks, at least it will show how to use the slide thing.

Your signature has been erased by a mod - 120 high maximum please
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 18:42
Quote: "here is a realy simple demo, dont know if it means anything "


THAT WAS EXACTLY WHAT I WAS LOOKING FOR!!!!!! Thanks so much, could i see the code snippet? It was like what I was looking for, smooth, gravity, jumping, everything!!!

Thanks, at least I know it is possible.

Your signature has been erased by a mod - 120 high maximum please
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 15th Jun 2008 19:42 Edited at: 15th Jun 2008 19:44
here it is, I know it is pretty ugly, but i put it together in like 5 min.


I am not sure exactly how the moveplayer() function works, but it id easy enough to manipulate. What I did at first its that I snapped a 3d model of my character to the sphere's oriantation and then I hid the sphere, so it looks like your character is effected by gravity/level objects.
Later you can figure out how to replace the command int collide = SC_SphereCastGroup( 1, oldx,oldy,oldz, oldx,oldy+vy,oldz, radius,0 ); with something else that would help you to use this kinda function directly with any kind of 3d object.

also..
to setup a terrain you need to use SC_SetupTerrainObject (1,1,1000 ); er sumthing.


you can change the bits that say... if (dbKeyState(32) == 1 ) { vx = vx + dbCos(angy); vz = vz - dbSin(angy); }... to change the keys

I know it is not perfect but it is somwhere to start.

Sephnroth - thanks for the info. BTW..do u know if Newton is OpenGl based?
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 15th Jun 2008 19:50
newton is nothing based. well, its c based Newton is a phsyics engine, nothing more. It has no commands for drawing graphics etc.

In the examples they use openGL to draw the graphics. But they could of just as easilly used directx or even dgdk

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 15th Jun 2008 19:51
Thanks so much RancidRat that i think explained everything!

Your signature has been erased by a mod - 120 high maximum please
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 15th Jun 2008 20:01
Thanks for setting things straight Sephnroth

Login to post a reply

Server time is: 2024-09-29 23:30:10
Your offset time is: 2024-09-29 23:30:10