New To Newton - Examples

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

New To Newton - Examples

Postby FlemMonk » Tue May 26, 2009 5:29 pm

I am new to newton and currently attempting to utilise the library with BlitzMax. Basically I have a few questions which I hope the community can answer:

1. Are there any simple/plain examples (does not matter what language) that demonstrate the basic commands needed to setup the scene/world and how to add gravity.
2. Does anyone know what sort of Matrices BlitzMax (in particular MiniB3D) uses, as I have read that there are different types. (I understand if you are unable to answer this).
3. I have already implimented the first tutorial in my project and I am able to receive changing values after calling the Update function. However the object does not move as expected, I beleive due to #2.

Appreciate your help and answers, would like to chat if possible with someone who has used Newton in BlitzMax/MiniB3D before.
FlemMonk
 
Posts: 14
Joined: Tue May 26, 2009 5:18 pm

Re: New To Newton - Examples

Postby stringa » Tue May 26, 2009 7:51 pm

you have to grab the matricies from the object( newton body ).... something like NewtonBodyGetMatrix() and use that new matrix when your drawing. If that doesn't work...make sure you apply a mass to you object....
stringa
 
Posts: 5
Joined: Fri May 08, 2009 6:39 pm

Re: New To Newton - Examples

Postby FlemMonk » Wed May 27, 2009 3:30 am

Sorry i think you misread #3, i already have values changing when i use getmatrix after the update function. but it does not move in the expected direction/rotation.
FlemMonk
 
Posts: 14
Joined: Tue May 26, 2009 5:18 pm

Re: New To Newton - Examples

Postby JernejL » Wed May 27, 2009 5:39 am

There's a newton wrapper for blitzmax which you can try to see if it solves your problem: http://www.blitzbasic.com/Community/pos ... opic=66659
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: New To Newton - Examples

Postby FlemMonk » Wed May 27, 2009 7:38 am

Thanks for the reply, however I could not find any reference to a BlitzMax wrapper in that thread. Besides I am not worried about that, as already stated I have Newton in my code already and the first project tutorial running, however I do not know how to apply gravity to the box and the box at the moment just rotates slowly for no reason at all.

I will try to simplify my question, How do you apply a global gravity to a world or a rigid body? If I can get the answer to that question then I can apply the gravity and see if the position on the Y axis changes for the rigid body.
FlemMonk
 
Posts: 14
Joined: Tue May 26, 2009 5:18 pm

Re: New To Newton - Examples

Postby Julio Jerez » Wed May 27, 2009 8:30 am

there is no global gravity in newton.
when you create the body you assigne a funtion callback that is resposable for applygin teh gravity to the body.
you can make a generuc funtion that apply gravity, and assign tah funtion by defauld at creation time.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: New To Newton - Examples

Postby JernejL » Wed May 27, 2009 8:53 am

FlemMonk wrote:Thanks for the reply, however I could not find any reference to a BlitzMax wrapper in that thread.


At the very top of that topic...

Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: New To Newton - Examples

Postby FlemMonk » Wed May 27, 2009 10:45 pm

Thanks Julio for replying, I was able to set a velocity on my body and ensured that the matrices were setup correctly and the object did infact move down the y axis, however not as expected. I beleive it is because of what you have explained, the new newton library uses call back functions and I am new to this, so I will have to check out the next tutorial.

If it is not explained in the tutorial, do you set a constant velocity or add force to effectively make 'gravity' in the callback function?

Delfi - Sorry mate but again, that is not a wrapper for BlitzMax and as stated before I do not need it. If you actually downloaded it, you will find its a wrapper for Blitz3D. And yes I am talking about the 2 links at the top of that page you have posted twice.
FlemMonk
 
Posts: 14
Joined: Tue May 26, 2009 5:18 pm

Re: New To Newton - Examples

Postby JernejL » Thu May 28, 2009 3:21 am

FlemMonk wrote:If it is not explained in the tutorial, do you set a constant velocity or add force to effectively make 'gravity' in the callback function?


During every newtonupdate newton will call the callback, there you add gravity during each update for each body separatedly.

FlemMonk wrote:Delfi - Sorry mate but again, that is not a wrapper for BlitzMax and as stated before I do not need it. If you actually downloaded it, you will find its a wrapper for Blitz3D. And yes I am talking about the 2 links at the top of that page you have posted twice.


If they are any similar (the names seem similar enough), you could use blitz3d wrapper to fix your blitzmax code.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: New To Newton - Examples

Postby FlemMonk » Thu May 28, 2009 4:12 am

Thanks for your help Delfi, but unless you have the source code for the wrapper that link is pretty much useless to me lol.
FlemMonk
 
Posts: 14
Joined: Tue May 26, 2009 5:18 pm

Re: New To Newton - Examples

Postby JernejL » Thu May 28, 2009 5:26 am

FlemMonk wrote:Thanks for your help Delfi, but unless you have the source code for the wrapper that link is pretty much useless to me lol.


Sorry, i didnt download the wrapper, i assumed it came with source.. but you could try contacting the author.
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 1 guest