Question on getting started

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Question on getting started

Postby Ahigh » Wed Feb 02, 2011 5:32 pm

So I've been digging through Newton for a couple of days now and about to start using it to do some basic cube collision stuff with cylinders.

My environment is:

1) Visual Studio 2010 Pro
2) OpenGL
3) Custom graphics engine (I already have routines to draw everything that I want to draw)
4) Very basic shapes .. but lots of them. Very similar to making towers and smashing them down

My engine is designed to do high speed physics (IE: small objects and/or large gravity-to-object-size ratio), which is why I chose Newton over Bullet. I found that Newton had better control over the iteration rate, and I plan to iterate multiple times per visual frame (a variable amount based on the speed of the fastest object in the world).

Interestingly, my engine also supports drawing a blurred image of the objects' path for the 16.67ms frame at 60hz. But that's a tangent of my question...

I have read through to see how the demos are working and how there is an external project for all the code in the math and scene libraries.

My question is, however, what is the minimal way to pull in the sdk? Can I simply copy the header files into a single directory, say "include\newton" or something similar and then put the libraries in "lib\newton" and set everything up to link like that, or is there a reason to pull all of the SDK source code into my project?

If I should set things up the way that the demos are set up with dependencies and keep all those files referenced in my project, is there a readme file somewhere that tells me step by step how to set up the dependencies and whatever else in Visual Studio that I need to do.

I know this is very much a Visual Studio question, but I am more of a linux type of a guy, and I don't really know everything about managing projects from Visual Studio.

I hope someone can help.
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby Julio Jerez » Wed Feb 02, 2011 5:39 pm

if you are a linux guy, then just use the Linux makefile
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question on getting started

Postby Ahigh » Wed Feb 02, 2011 6:09 pm

No it has to run in visual studio .. and it has to be usable by guys who only know visual studio.

It's okay, I completely capable of figuring everything out on my own. Thanks anyway.
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby JernejL » Thu Feb 03, 2011 5:00 am

The most minimalistic thing needed are just newton.h and the newton.dll / newton.lib.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Question on getting started

Postby Ahigh » Thu Feb 03, 2011 3:28 pm

I already brought in the full SDK including dMath dJointLibrary dContainers glew and tinyxml .. and set up all the include files for the entire sdk subdirectory.

I was going the minimal route, but the problem is that I was ending up writing too much code to get what I wanted.

I definitely would like to see another path .. maybe something more similar to what bullet is doing with a simple C application that does some stacked boxes and lets you fire another box at the stack to destroy it without so much need for XML and scene graphs and so on in terms of "SDK" code which is actually sort of a grey area of what should be in a library versus being source code provided with a lot of little header files that you need to pull the whole thing into your project.

The demos in newton show how the library links and compiles, but aside from watching some things slide down a slope, there's not much interactive about the demos .. I like how bullet allows me to fire boxes at pretty much any demo.
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby Julio Jerez » Thu Feb 03, 2011 8:36 pm

if you want to see more interative demos, you can dowload an older version like SDK 2.21
the latest version do not have many demos because I am working on an Editor and the XML format that will replace the demos hard code demos.

However if you fell that some other engine satisfy all your needs, why not staying with it?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question on getting started

Postby Ahigh » Fri Feb 04, 2011 3:54 pm

Thanks for the suggestion on going back to 2.21 for more interactive demos.

I will figure this stuff out. As far as why to switch from Bullet .. I found that specifically, stacked cylinders works better in newton and that's something that I need to work well.
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby Julio Jerez » Sat Feb 05, 2011 10:41 am

yes 2.21 has about 30 interactive demos, many of them are stacking of different shapes
You can download it and play the demos, by do not use the libraries since there are changes and bug fixes since in between 2.21 and 2.30

The problem is that I am 2.21 use a WxWidget and after that and change to MFC, and I have no time to port all the demos.

that will be fixes when teh Alchemdia Editor is become an working application, the there will be no demos,
just the alchemedia and the demos will be a run time viewers launchable from alchemedia.
I am planning to add, the NewtonSDKDemos, OpenScenGraph, Irrlithc, and maybe Ogre, as launchable plugins.
This is the reason work has stopped the wok on the demos, I am focusing in the editor.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question on getting started

Postby Ahigh » Mon Feb 07, 2011 2:55 pm

Julio,

Just a word of warning, and I hope my comments are received well: be careful spending time on editors. It has been a learning experience that started in 1984 for me: the editor can sink all of your time very quickly, and the satisfaction level is always short of complete. If you have a solid interface and you can break things into layers, many people will find multiple ways to get into and out of your run-time environment.

Also, there are many people capable of writing good editors. There are far fewer people with your expertise for handling the difficult parts of the simulation.

Now I am new to Newton, but I have been programming physics for video games for well over a decade. I was the lead programmer on San Francisco Rush 2049 for Atari Games (released in August 1999). I created all kinds of editing and tools for my previous employer at Paradigm Simulation that was used on Beetle Adventure Racing after I left, and some other titles.

However, when I started at Atari, all that work on editors didn't help me. I was depressed for a little while that I couldn't use all that stuff I made. And it takes a very long time to make these kinds of tools.

But what I found was there were still some bugs in the Physics Implementations of the original Rush product that had never been fixed, and made it very difficult to drive the game without crashing. Without any tools (I used the gdb debugger) I implemented a slow-motion mode (you would hit the music button and press in the clutch) and it would run the physics in slow-motion depending on how far you pressed in the clutch. So I could then drive into the conditions where this weird physics bug was, and then hop in the debugger. I successfully fixed that bug, which ended up being a normal vector for the tire that was up relative to the tire orientation instead of the road, and the game was instantly way more better.

LOL. I know this is a lot of detail, but I did, and all of a sudden, all kinds of people became more interested in the game. It amounted to a few characters of code changes, but it was ever so important.

Now I am not making any analogies in saying that there are bugs in Newton .. but all physics engines suffer from round-off error, and in general, and in my opinion, all physics engines are in competition with each other. I am not the ultimate supreme expert in judging one from the other, and frankly, I have used very few of them myself.

But I can say that I am here and that I approve of the work that you have done so far and that your engine has risen to the top of my interest list as a programmer. I am working on a project that needs this type of thing, and accuracy and ability to change the iteration rate and still perform well for very small objects is what has me still going on this.

And at the same time, the thing that is getting in my way is just the basics of get the thing compiling, and what calls do I make to have a cube bounce on the floor or just anything, really.

So that's about the best I can do to give some feedback for you. It's entirely positive, I hope. Just a word of caution to let your time get * away with anything approaching graphical user interfaces if you have the expertise with making a physics simulation without errors .. that is something that people all over the world are in need of. And sometimes a big company can't even provide it because they become so involved with other issues related to doing business and making money and so on.

The best of luck to you in success in all of life. I will keep you updated with my progress, and thanks so much for making your work available to others to benefit from!

- Aaron Hightower
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby Julio Jerez » Mon Feb 07, 2011 3:35 pm

Ahigh wrote:
Just a word of warning, and I hope my comments are received well: be careful spending time on editors. It has been a learning experience that started in 1984 for me: the editor can sink all of your time very quickly, and the satisfaction level is always short of complete. ...

I agree making and editor is a time resort consumer.
However the idea of this editor in to the general Idea of a Game level editor, itis more a way to expose graphical how to use the new File format of the engine.

Basically this editor will serve there purpose:
1-A Geometry Brower and file converter to the Newton file format.
2- And starting point for anyone who want to take and make his or her own Game level editor. for thsi I only add functionality on per need basis.
3-My own visual tool for adding Newton Game features. The engine is now at a point that any new functionality required visual design.
for a while I have being working on some new functionality like Fracture, and soft body but I always get stocked when exposing the demos.
It is always very hard to make demos that are pedagogically and at the same time appealing by using command line.
So the is why I am trying to do it graphically.


Ahigh wrote:
Now I am not making any analogies in saying that there are bugs in Newton .. but all physics engines suffer from round-off error, and in general, and in my opinion, all physics engines are in competition with each other.

actually I am not in competition with anyone, It is some of the people in some forums who had dedicated lots of time to trash me, prophetically and personally.
Hey they are one or Tow university professor for Virtual Reality Lab who had spent year given his student dissertation when the main topic is how do Discredit me.

They have and axe to grind because ever since Newton came out it end they era of high paid Consultant Jobs for people self appointed experts.
Newton can do it better more, accurate, and it is free, and they do not like that, So their respond is to Flood the internet expert with dishonest "Expert Opinion" all criticizing my work.


The minimal Netwon set up is to just get:
Newton.h, Newton.Lib (static or dll)

Or you can look at the wiki tutorials:
http://newtondynamics.com/wiki/index.ph ... =Tutorials
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question on getting started

Postby Ahigh » Wed Feb 09, 2011 2:31 am

Just an update: using the 2.21 examples was the key for me. I really needed to see the sample code with less stuff for trying to export too much to XML and other files.

Just seeing the calls I need to make in the Newton API from a sample app is what I need.

I'm sure you can understand that it's hard to imagine what someone who is new doesn't already know in terms of what calls need to be made.

I was just reading all of Newton.h and trying to figure it out .. and trying to trace through the debugger for the other app demos that were in the latest release, but that was just too frustrating.

Seeing how many other things had been done kept me going that if they could do it, it had to be doable. But having all of those demos in the 2.21 SDK is something that if you haven't ever seen those before and/or looked at the code for them, it puts you at a real disadvantage for seeing how things work in the newton library.
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby Julio Jerez » Wed Feb 09, 2011 2:31 pm

Ahigh wrote:I was just reading all of Newton.h and trying to figure it out .. and trying to trace through the debugger for the other app demos that were in the latest release, but that was just too frustrating.
Seeing how many other things had been done kept me going that if they could do it, it had to be doable.


But the latest release is made do that it is easier to do things.
Basically they scene is created from and archive that is saved in a xml format.

That is the only way I can find to move Newton to more advance functionality, Otherwise make simple intuitive demos will always keep she engine looking bad because the demos will be so simple that
people will think the engine is simple.
if you look at Google Sketchy Physics videos in you tube, you can see the scoop of the Newton engine Newton,
here is a demo http://www.youtube.com/watch?v=4Ebg7mylkiQ&feature=player_embedded
but that is only possible when you unleashing the power of a visual modeling.

Like I said you can check out the Wiki tutorial if you find too complicated, then you see the basics for to makeing bodies, collision and joints, and the you can you can look at the demos again.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Question on getting started

Postby Ahigh » Wed Feb 16, 2011 6:33 pm

Just a status update, I have everything working and it's doing very good stuff. I can stack over 200 cylindrical objects and integrate physics multiple times per frame to get the smaller scale that I'm looking for with relatively good stability considering the number of objects.

I've only seen one aberrational thing and that is when the stack is very high, the top cylinder can sometimes do some things that cannot be explained by normal physics. It hinges slowly about it's edge with the edge of the cylinder below it until it slowly lifts and hinges around and then falls from the top of the stack.

But overall, this is a very extreme case and not something that I'm worried about needing to work around. I don't think I really even need stacks so high anyway.

I didn't need any of the dScene or other things .. I'm just using the dll and header file pretty much and I guess the lib for linking.

Just wanted to update with my progress and to say thanks to the author for such great work.
Ahigh
 
Posts: 7
Joined: Fri Jan 28, 2011 6:45 pm

Re: Question on getting started

Postby Julio Jerez » Wed Feb 16, 2011 6:56 pm

Ahigh wrote:Just a status update, I have everything working and it's doing very good stuff. I can stack over 200 cylindrical objects and integrate physics multiple times per frame to get the smaller scale that I'm looking for with relatively good stability considering the number of objects.

Make sure you can teh engien with a fix time step, a variable time step make the solver behave extrange.
I can be explain it mathematically but, I am not going to go there now I have lot of thing I am workin at the moment.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests