A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by kikosmalltalk » Mon Apr 27, 2009 4:05 pm
Hi Julio
thanks to reply
You wrote:
it looks like you are using a back matrix.
are you using scale with you model matrices?
Scale matrix ?.
Sorry but I don't understand. Any example please.
I only create the cone and Set an identity Matrix.
This way
- Code: Select all
>>addCone
"Create a Cone collision primitive"
| collision actor matrix inertia newtonBody |
matrix := NewtonMatrix identity.
"(_11=1.0 _12=0.0 _13=0.0 _14=0.0
_21=0.0 _22=1.0 _23=0.0 _24=0.0
_31=0.0 _32=0.0 _33=1.0 _34=0.0
_41=0.0 _42=0.0 _43=0.0 _44=1.0)"
collision := NewtonCone
in: self world
radius: 5.0
height: 20.0.
inertia := collision calculateInertiaMatrix.
newtonBody := NewtonRigidBody in: self world withCollision: collision.
newtonBody
matrix: matrix;
massMatrix: 100.0
inertiaX: inertia x * 100
inertiaY: inertia y * 100
inertiaZ: inertia z * 100;
setForceAndTorqueCallback: newtonBody;
setTransformCallback: actor.
self addBody: newtonBody
Look this screenShot:
Advanced thanks
- Attachments
-
- screenShot.JPG (30.89 KiB) Viewed 2978 times
-
kikosmalltalk
-
- Posts: 31
- Joined: Mon Dec 04, 2006 10:48 am
- Location: Argentina
by kikosmalltalk » Tue Apr 28, 2009 8:25 am
Hi Julio, delfi, all
Look this:
The floor body is locate in the position:
Vec[ 0.0 -80.0 0.0 ].
And the AABB is: #{
Vec[ -250.125 -2.625 -250.125 ]
Vec[ 250.125 2.625 250.125 ]
}.
The size is: 500 , 5 500 and 0 mass.
The cone is locate in :Vec[ -2.87527441978455 -75.0752563476563 -2.34281104058027e-002 ]
AABB is: #{
Vec[ -10.125 -5.125 -5.125 ]
Vec[ 10.125 5.125 5.125 ]
}.
The radius is 5 and height is 20. The mass is 100
Any idea ?
ScreeShot:
- Attachments
-
- NewtonJet3d.JPG (28.79 KiB) Viewed 2969 times
-
kikosmalltalk
-
- Posts: 31
- Joined: Mon Dec 04, 2006 10:48 am
- Location: Argentina
by kikosmalltalk » Tue Apr 28, 2009 10:25 am
Hi All
I'm become crazy
Look this:
http://www.youtube.com/watch?v=te8UE1tfmAIThe floor box have 5 degrees of inclination in the X axis, the sphere should lower !!. And of course not to penetrate in the floor.
Any idea ?
kiko
-
kikosmalltalk
-
- Posts: 31
- Joined: Mon Dec 04, 2006 10:48 am
- Location: Argentina
by kikosmalltalk » Tue Apr 28, 2009 1:46 pm
Hi All
The problem is solved
I'm sorry, not was a newton error, was my error.
When I draw the geometry and call the NewtonCollisionForEchaPolygonDo:, I passed the incorrect matrix to the function.
Then I draw an incorrect collision mesh !.
For that reason the geometry was shown bad !.
Sorry again
kiko
-
kikosmalltalk
-
- Posts: 31
- Joined: Mon Dec 04, 2006 10:48 am
- Location: Argentina
by JernejL » Wed Apr 29, 2009 3:51 am
Good to see that you solved the problem.
-
JernejL
-
- Posts: 1578
- Joined: Mon Dec 06, 2004 2:00 pm
- Location: Slovenia
-
by Julio Jerez » Wed Apr 29, 2009 6:23 pm
kikosmalltalk wrote:When I draw the geometry and call the NewtonCollisionForEchaPolygonDo:, I passed the incorrect matrix to the function.
Then I draw an incorrect collision mesh !.
you see I told you, there was a wrong matrix somewhere,
It is like they say "More knows the devil because he is old and not because he is smart"
-
Julio Jerez
- Moderator
-
- Posts: 12249
- 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 16 guests