Slicing Boxes - found out why it was buggy

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Slicing Boxes - found out why it was buggy

Postby Carli » Wed Oct 28, 2009 4:05 am

Hi,

I found out, why/when exactly the boxes where slicing over the ground:
I created a ground box with size 1|1|1 and scaled the matrix to to 1000|20|1000 - the boxes are slicing over the ground box and were keeping rotated
when I scaled the ground to 1000|1|1000, it works fine.

i suspect that if i would let the boxes hit the side of the ground box, the bug would be 1000 times stronger
i also suspect that there is no normalization when using scaled matrices

so my question:
should i use scale matrices or is there an other way to get the collision to an other size... (or maybe you implement a normalization of the normals - which costs computing time)
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Slicing Boxes - found out why it was buggy

Postby JernejL » Wed Oct 28, 2009 7:21 am

As far as i know, the only proper way to scale a body in newton is a convex matrix modifier using a convex hull object, are you using this or setting custom matrices?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Slicing Boxes - found out why it was buggy

Postby Carli » Wed Oct 28, 2009 11:22 am

i abused the position matrix to set the size.
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Slicing Boxes - found out why it was buggy

Postby JernejL » Wed Oct 28, 2009 1:53 pm

Carli wrote:i abused the position matrix to set the size.


As i said that's not supported and the results of it are "undefined".. you need to use convex hull modifier, it's the only supported way to change size of objects.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Slicing Boxes - found out why it was buggy

Postby Carli » Thu Oct 29, 2009 4:28 am

But a convex hull modifier would not affect the graphics...
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Slicing Boxes - found out why it was buggy

Postby JernejL » Thu Oct 29, 2009 5:55 am

Carli wrote:But a convex hull modifier would not affect the graphics...


You'll just need to apply additional step to add scaling back to the matrix, what you are doing currently is just not supported..
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Slicing Boxes - found out why it was buggy

Postby Carli » Thu Oct 29, 2009 7:02 am

i didn't know if i said it before but i'm working at a script->physic->graphic interface for a game engine and the idea behind is that the graphics are independend from the rest - that means you could also stream the object matrices per network (just like masterservers do)

the object oriented idea is that you just have interfaces from where you call "methods" but no one knows the code behind it - that means you can replace each code for a new platform for example. i think newton is in this way a bit too specialized and i have to write too many wrappers.

You'll just need to apply additional step to add scaling back to the matrix, what you are doing currently is just not supported..

that all would cause network traffic
Carli
 
Posts: 245
Joined: Fri Oct 02, 2009 5:28 am

Re: Slicing Boxes - found out why it was buggy

Postby JernejL » Thu Oct 29, 2009 8:00 am

Carli wrote:i didn't know if i said it before but i'm working at a script->physic->graphic interface for a game engine and the idea behind is that the graphics are independend from the rest - that means you could also stream the object matrices per network (just like masterservers do)

the object oriented idea is that you just have interfaces from where you call "methods" but no one knows the code behind it - that means you can replace each code for a new platform for example. i think newton is in this way a bit too specialized and i have to write too many wrappers.

You'll just need to apply additional step to add scaling back to the matrix, what you are doing currently is just not supported..

that all would cause network traffic


What's the difference if you call NewtonConvexHullModifierGetMatrix instead of NewtonBodyGetMatrix? that matrix would still be a ordinary 4x4 matrix, so your argument about extra network traffic makes no sense.

It was mentioned on forum for a dozen of times that scaling bodies by setting matrix is unsupported, the only proper way to scale them is using NewtonConvexHullModifierSetMatrix, i'll fix the documentation on wiki to make this clearer.
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 0 guests

cron