So, I think it is time to give a close overview about my progress on extending minib3d:
First the good news: Maybe some of you could remember the
Shaderbased PostFX code/demo of Anthony. So I have succesfully integrated it to my extended Version without the restriction of Anthonys Version (it was only usable with squared resolutions).
Also the newton implementation comes along nicely. I'm currently working on the material system. And ther I need some help, but this will come later.
Here is a small demo (win32 only) :
Minimum requirement is a shader 2.0 gfx card
http://klepto2.kl.funpic.de/DL/NewtonPostFX.rar
Controls:
Enter --> Spawn new random boxes
F1/F2 --> Change Default Elasticity
F3/F4 --> Change Default Friction
F5/F6 --> Change Default Softness
F7/F8 --> Change the bullets mass (boxes have a random mass)
Keys 0-3 --> Apply PostFX (you can combine all)
Space --> Turn Vsync off (don't move mouse hard because you may leave the window )
Left Mousebutton: Fire bullet
Right MouseButton : Apply random Force to a picked body
Also here is a small (30 sec.) video:
http://www.myvideo.de/watch/772486
Now I have a problem with the materials:
My plan was/is to create a mainly abstract layer to the newton engine. And to achieve that I planned a material type
in which you could create different materials. But to simplifiy things I want to add an automated function which will apply the different values to each other available material. But to do this I have to know how to calculate (if this this possible) the friction between 2 different materials. EG: mat a has a friction of 0.8, mat b has friction of 0.3 . So what is the friction when both interact?
Btw: You could also override the material settings by yourself. So the automated thing is just a simplification (5 materials already have a minimum of 25 different combinations).
If someone already has some experience with newton and know how to calculate this, I would be really happy.
thx klepto2
PS:
@Chris: sorry I had some problems with my email account (so I'dont know if my answer has arrived):
I think you have to change the Rotations to euler based rotations and then simply rotateEntity().
The code how it is currently down in my wrapper:
and the corrosponding functions:
Also as soon the material system works properly I will send you the code to create a (hopefully working) linux version.
First the good news: Maybe some of you could remember the
Shaderbased PostFX code/demo of Anthony. So I have succesfully integrated it to my extended Version without the restriction of Anthonys Version (it was only usable with squared resolutions).
Also the newton implementation comes along nicely. I'm currently working on the material system. And ther I need some help, but this will come later.
Here is a small demo (win32 only) :
Minimum requirement is a shader 2.0 gfx card
http://klepto2.kl.funpic.de/DL/NewtonPostFX.rar
Controls:
Enter --> Spawn new random boxes
F1/F2 --> Change Default Elasticity
F3/F4 --> Change Default Friction
F5/F6 --> Change Default Softness
F7/F8 --> Change the bullets mass (boxes have a random mass)
Keys 0-3 --> Apply PostFX (you can combine all)
Space --> Turn Vsync off (don't move mouse hard because you may leave the window )
Left Mousebutton: Fire bullet
Right MouseButton : Apply random Force to a picked body
Also here is a small (30 sec.) video:
http://www.myvideo.de/watch/772486
Now I have a problem with the materials:
My plan was/is to create a mainly abstract layer to the newton engine. And to achieve that I planned a material type
in which you could create different materials. But to simplifiy things I want to add an automated function which will apply the different values to each other available material. But to do this I have to know how to calculate (if this this possible) the friction between 2 different materials. EG: mat a has a friction of 0.8, mat b has friction of 0.3 . So what is the friction when both interact?
Btw: You could also override the material settings by yourself. So the automated thing is just a simplification (5 materials already have a minimum of 25 different combinations).
If someone already has some experience with newton and know how to calculate this, I would be really happy.
thx klepto2
PS:
@Chris: sorry I had some problems with my email account (so I'dont know if my answer has arrived):
I think you have to change the Rotations to euler based rotations and then simply rotateEntity().
The code how it is currently down in my wrapper:
Method Update() newtonBodyGetMatrix(Node , Mat) NewtonBodyGetVelocity(Node,Velocity) NewtonBodyGetOmega(Node,Omega) Max3DSetMatrix(Self,Mat) PositionEntity(Mesh,PosX,PosY,PosZ) RotateEntity(Mesh,RotX,RotY,RotZ) End Method
and the corrosponding functions:
Function Max3DGetMatrix(Node:TNewtonObject , NewtonMat:Float Ptr) Local Euler:Float[3] Euler[0] = Node.rotX * (Pi / 180.0) Euler[1] = Node.rotY * (Pi / 180.0) Euler[2] = Node.rotZ * (Pi / 180.0) NewtonSetEulerAngle(Varptr Euler[0] , Varptr newtonMat[0]) Newtonmat[12] = Node.PosX newtonMat[13] = Node.PosY NewtonMat[14] = Node.PosZ End Function Function Max3DSetMatrix(Node:TNewtonObject , NewtonMat:Float Ptr) Local Euler:Float[3] NewtonGetEulerAngle(Varptr NewtonMat[0] , Varptr Euler[0]) Node.Posx = NewtonMat[12] Node.Posy = NewtonMat[13] Node.Posz = NewtonMat[14] Node.rotX = Euler[0] * (180 / Pi) Node.rotY = Euler[1] * (180 / Pi) Node.rotZ = Euler[2] * (180 / Pi) End Function
Also as soon the material system works properly I will send you the code to create a (hopefully working) linux version.