Newbie questions

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Newbie questions

Postby firoball » Thu Sep 10, 2009 10:14 am

Hi,

I have already worked with Newton and the Dark GDK, but did only very basic stuff so far.

Currently I'm trying to get a setup in Acknex7 to run. This is working fine so far, but I was wondering what am I supposed to do to get rid of auto freezing in Newton 2? The old freeze commands don't seem to exist anymore.

Also I have a crated a hinge which basically works, but gives me some headache when adding torque or force to it.
I've basically taken the Swing Door example from the Newton 1.5 tutorials and it's just what I need, but additiionally I want to accelerate the hinged body by pressing a key as long as the key remains pressed. This also is working fine, but I have problems with the angle limitation.
First of all I don't udnerstand the Callback code, as this Newton...StopAlpha() function seems to be explained nowhere. Also I'm wondering how to get rid of this bouncing. What I want is a certain amount of torque to force rotation of my body, until it has reached the angle limit, and then it should stay there (at the exact degree!). Fixed. No swining, nothing. As soon as I release the key it moves back to it's original position.

I'm pretty sure this is basic stuff and I don't expect fully working code. I've read that using the old hinge is not good, so I'm wondering what to use instead. Some keywords are fine, so I can dig deeper into it.
Maybe someone can give me a hint for the right approach to this problem as my tries failed.
Maybe there's also a tutorial I missed?

Also I'm still searching for some Newton 2 Manual. Up to now I still used the Newton 1.5 Manual.

Please point me into the right direction, most likely I'm overseeing the obvious.

Thanks a lot for your help.
firoball
 
Posts: 4
Joined: Thu Sep 10, 2009 9:45 am

Re: Newbie questions

Postby Julio Jerez » Thu Sep 10, 2009 1:32 pm

there is a new series of simple tutorial for begginers to get started
http://newtondynamics.com/wiki/index.php5?title=Tutorials

I suggest you chek them out, it implement a hinge, an doteh joint usin teh custom joints.
The stop alpha stuff is there for backwork compatibilty only.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newbie questions

Postby firoball » Fri Sep 11, 2009 2:28 am

Thanks, I will take a look.

Any chance to turn off auto freezing in Newton2?
firoball
 
Posts: 4
Joined: Thu Sep 10, 2009 9:45 am

Re: Newbie questions

Postby firoball » Sun Oct 04, 2009 6:30 pm

Got almost everything to work just fine now.
One big problem is left though.

I'm working in a level which has a size below 150 cm * 150 cm.
If I calculate this over to meters taking the engine's internal resolution into account I end up with a very small factor. Using this one kills the collision behaviour entirely. Most likely due to inaccuracies.

Next step I did was using a bigger scale for the world (factor 4) and then I multiplied any metrical value by 4 to get back the old behaviour.
This works good for gravity. I also did this for the moment of inertia, but it just does not feel right. I'm pretty sure there are way too many dependencies and I won't get anywhere by just patching a few variables.

Long text, short question:
Does Newton provide some global scale factor which I can set in order to get around the problem with inaccuracies but no need to patch around with my physical variables/properties?

I've seen there is some function like NewtonGetGlobalScale(), but there does not seem to be the ...Set... counter part. Am I missing something obvious here?
firoball
 
Posts: 4
Joined: Thu Sep 10, 2009 9:45 am

Re: Newbie questions

Postby JernejL » Sun Oct 04, 2009 6:33 pm

firoball wrote:Long text, short question:
Does Newton provide some global scale factor which I can set in order to get around the problem with inaccuracies but no need to patch around with my physical variables/properties?

I've seen there is some function like NewtonGetGlobalScale(), but there does not seem to be the ...Set... counter part. Am I missing something obvious here?


Global scale feature has not been supported since.. very early 1.x versions, that is, if it ever was.

I hope julio can help you resolve what you need to scale properly.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newbie questions

Postby firoball » Wed Oct 21, 2009 4:15 pm

I'm still stuck at that problem.

My scale factor is 0.0009285 for engine units to meters.
This should still fit into a float, but I guess some internal calculation gets problems with such small numbers. The collision is completely non working.
It only works reliable if I use a four times bigger scale factor - but this will distort the physics simulation, so what I need is some sort of global scale factor.

Is there anything like this existing?
For now I'm adjusting gravity, weight and moment of inertia. This helps but it still is not the same...
firoball
 
Posts: 4
Joined: Thu Sep 10, 2009 9:45 am

Re: Newbie questions

Postby JernejL » Wed Oct 21, 2009 4:37 pm

firoball wrote:I'm still stuck at that problem.

My scale factor is 0.0009285 for engine units to meters.
This should still fit into a float, but I guess some internal calculation gets problems with such small numbers. The collision is completely non working.
It only works reliable if I use a four times bigger scale factor - but this will distort the physics simulation, so what I need is some sort of global scale factor.

Is there anything like this existing?
For now I'm adjusting gravity, weight and moment of inertia. This helps but it still is not the same...


It's a limit of cpu floating point precision, there is no way around it, you'll see same happen with every other physics engine on such low scales.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron