• Advertisement
Sign in to follow this  

PhysX and DirectX

This topic is 3873 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Thanks for the link, but most of api has changed since the example was written and it wont compile with the latest sdk. Is there any newer one out there?

Share this post


Link to post
Share on other sites
I had the same problem as you. I needed some info on DX an PhysX, cause the docs in the SDK are most for OGL. I found this example and used also the docs of PhysX. Now PhysX works well with DX in my app.

Share this post


Link to post
Share on other sites
If you don't mind using DirectX through a 3rd party graphics engine, then I can vouch for a setup that works:

Ogre3D + PhysX.

There's a wrapper which makes things really really simple. I used it myself and it works most splendidly.

Share this post


Link to post
Share on other sites
Quote:
Original post by NQ
If you don't mind using DirectX through a 3rd party graphics engine, then I can vouch for a setup that works:

Ogre3D + PhysX.

There's a wrapper which makes things really really simple. I used it myself and it works most splendidly.


Actually this is how i started. ogre3d + nxogre. But now i feet that the time came to move on. This is why i want this DX + PhysX example

Share this post


Link to post
Share on other sites
I'm not sure I fully understand what the problem is. PhysX is your Physics API, DirectX is your graphics & potentially input/sound API. It's a really straight forward integration:

1) read the PhysX SDK docs so you understand how to set up your simultation
2) learn to use DirectX for rendering

Now all you do is render your objects where PhysX says they are: you can query any physics object's orientation & translation and any other physics parameter that might influence your rendering. You also get hooks for things like OnCollide, etc so you can implement trigger and hit reactions and such.

There's no "standard" way to integrate the two systems because that's entirely up to the specific architecture of your game. Your game logic is a separate system from the physics or the rendering but it will essentially play the middle man between the two. How it middle-mans is really up to you.

There really won't be any direct communication between the physics and the rendering so in a sense there's nothing to integrate. It's really 2 separate questions:

1) how do i integrate PhysX into my game
2) how do i use DirectX in my game

-me

Share this post


Link to post
Share on other sites
@Palidine

I know the principles of working with them together. What I need is an example. A simple app that uses the two.

Share this post


Link to post
Share on other sites
Quote:
Original post by spooky_paul
I know the principles of working with them together. What I need is an example. A simple app that uses the two.


You don't actually need it; and I'm not sure a good example exists for something that specific.

The docs in the PhysX SDK should provide enough information for you to get the simulation running. There are plenty of tutorials for getting DirectX running. After that it's really just an exercise in logic (i.e. do you understand / can you figure out how to make a game engine).

I'm really not trying to be an ass, it's just once you get to the point where you're programming on a sufficiently advanced level there aren't tutorials to walk you through things anymore. You need to start learning how to design a system without copy/pasting someone else's code.

-me

Share this post


Link to post
Share on other sites
i do agree with you. but when there is a deadline looming copy/pasting is great way to speed up the development.

Share this post


Link to post
Share on other sites
Quote:
Original post by spooky_paul
i do agree with you. but when there is a deadline looming copy/pasting is great way to speed up the development.


Hope it's not too close or that you already have a lot of your engine written.

Even under the best of circumstances it'll take you around 1-3 months of full-time development to get a PhysX/DirectX engine up and running from scratch with even just a tiny bit of functionality. And that's if you already know exactly what you're doing.


[EDIT: sorry. i'm just being a bit of an ass today. hard to fight the "asshole cynical programmer on the internet" mentality today.... =) good luck]

-me

[Edited by - Palidine on July 13, 2007 1:35:56 PM]

Share this post


Link to post
Share on other sites
i have some directx experience and regarding physx all i need is rigid body physics and the character controler. i hope i`ll do alright

Share this post


Link to post
Share on other sites
Wow, just flat out admitted to stealing code... Watch its for a commercial product too.

Best part is, people helped even after he said he wanted to steal it. Have people totally lost their moral compasses?

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike2343
Wow, just flat out admitted to stealing code... Watch its for a commercial product too.

Best part is, people helped even after he said he wanted to steal it. Have people totally lost their moral compasses?


No. Most of his posts seem to be from someone who has just started programming. In fact, his first post was the standard which engine question most beginners ask. In another post, he said that he and his partner are working on a game engine together, which makes me believe the deadline is self-imposed and not because it is a commercial project. As far as stealing the code, the license states "Copyright: Use this however you want, but I am not responsible for anything", so I doubt the author is losing sleep over someone using his code. Furthermore, since he is a beginner, I'm sure you and every programmer that has ever done written more than hello world can relate to the copy and paste portion of their programming education (and those who have never gotten past hello world for that matter). All of us at some point have stolen code and tweaked it to our own needs and I doubt you are any different. I'm sure as he continues he will work his way out of copy and paste mode and into writing it himself as all experience programmers do. It is nice to know however, that if my moral compass has been lost, it has been replaced by logic and reason.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike2343
Wow, just flat out admitted to stealing code...


you got me all wrong. copy-pasting this simple example licensed "as-is" gives me an app with a simple framework to research and develop later on it. having a practical example that you know it works is a good guide.

i do not intend to steal any code, i wont be copy-pasting chucks of ogre, irrlicht, crystal space and any other rendering/game engines.

@latentdisposition

yes this is true the deadline is self-imposed, but this is how we get things done even this being a hobby project. i have just turned attention to the programing side of game development. having a 3d-artist background i find it sometimes hard to navigate though the api, and an example of the working code make me understand how the different parts work together and get me going

i do not understand why inspiring from other peoples work is damned (at this low-level). i am still using the windows api snippet to initialize a window i learned in my first directx tutorial. (even though some parts of it changed in time) when i have asked how to center a window, somebody answered with this "GetSystemMetrics(SM_CXSCREEN)/2-xScreenSize/2". that i just copy-pasted in my app initially, but then spent time on msdn because i wanted to find out more regarding the function`s capacities. is that considered stealing to?

[Edited by - spooky_paul on July 14, 2007 3:23:48 AM]

Share this post


Link to post
Share on other sites
Quote:
but when there is a deadline looming copy/pasting is great way to speed up the development.


That just doesn't sound like something you're doing for a learning project. Sounds like something you're doing to speed up production code. If you ment otherwise, fine but it does not in anyway, to me, sound like you were just copying/pasting for learning purposes.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement