Irrlicht Wrapper for 3D games and applications
-
- Posts: 8631
- Joined: May 28, 2005 3:28
- Contact:
@Frank
Gfx and physics libs used more and more quaternions to represent rotation.
One point (there are more) is the eulers gimple pitfall and how simple you can lerp between two quaternions.
How ever, be sure that your quaternion are in range of 0.0 to 1.0 after you square it before you convert it back to euler angles.
Joshy
Gfx and physics libs used more and more quaternions to represent rotation.
One point (there are more) is the eulers gimple pitfall and how simple you can lerp between two quaternions.
How ever, be sure that your quaternion are in range of 0.0 to 1.0 after you square it before you convert it back to euler angles.
Joshy
Code: Select all
Sub PhysicsSetNodePositionAndRotation( obj as physics_obj )
' get the node associated with this body
Dim as irr_node node = obj.node
' get the new position of the ODE geometry
Dim as dReal ptr ode_pos
ode_pos = dBodyGetPosition( obj.body )
' set the position of the scene node to match the ODE geometry
IrrSetNodePosition( obj.node, ode_pos[0], ode_pos[1], ode_pos[2] )
' get the ODE geometry rotation quaternion
Dim as dQuaternion ptr result
result = cast( dQuaternion ptr, dBodyGetQuaternion( obj.body ))
' convert it to euler angles
Dim as dReal w,x,y,z
w=result->q(0)
x=result->q(1)
y=result->q(2)
z=result->q(3)
' calculate the squares of the Quaternion parameters
Dim as double sqw = w*w
Dim as double sqx = x*x
Dim as double sqy = y*y
Dim as double sqz = z*z
Dim as double l = sqx+sqy+sqz+sqw
if (l<>0) then
if (abs(l-1)>0.00001) then
l=1.0/sqr(l)
x*=l
y*=l
z*=l
w*=l
sqw = w*w
sqx = x*x
sqy = y*y
sqz = z*z
end if
end if
' convert them to euler angles
Dim as single eX, eY, eZ
eZ = atan2( 2.0 * (x*y + z*w),( sqx - sqy - sqz + sqw)) * 57.295779513
eX = atan2( 2.0 * (y*z + x*w),(-sqx - sqy + sqz + sqw)) * 57.295779513
eY = asin( -2.0 * (x*z - y*w)) * 57.295779513
' set the rotation
IrrSetNodeRotation( obj.node, eX, eY, eZ )
End Sub
-
- Posts: 444
- Joined: Mar 10, 2006 19:22
Hi Joshy,
Thanks for the heads up I will do a quick search through the files and replace anything I find for the next real release.
I did mean to post some progress earlier but I keep on getting caught by mission creep I will try to post an update of the wrapper (even with the crash) soon.
Thanks for the heads up I will do a quick search through the files and replace anything I find for the next real release.
I did mean to post some progress earlier but I keep on getting caught by mission creep I will try to post an update of the wrapper (even with the crash) soon.
Last edited by Frank Dodd on Jun 23, 2011 23:26, edited 1 time in total.
-
- Posts: 444
- Joined: Mar 10, 2006 19:22
Once again mission creep and constant faffing has meant that this has been delayed quite a bit I did want to get it up on Friday but there were plenty of minor issues to iron out. A development release will be coming soon I hope.
Last edited by Frank Dodd on Jun 22, 2011 17:34, edited 1 time in total.
-
- Posts: 444
- Joined: Mar 10, 2006 19:22
when i run XEffects examples from example 99 to 102 it gives this error
Could not open file of texture: XEFFECTS_SM_512
XEffects: Please ignore previous warning, it is harmless.
FBO has one or several incomplete image attachments
FBO error
FBO incomplete
i am using the latest wrapper download. are there users also have this problem ??
all other examples are running okay
Could not open file of texture: XEFFECTS_SM_512
XEffects: Please ignore previous warning, it is harmless.
FBO has one or several incomplete image attachments
FBO error
FBO incomplete
i am using the latest wrapper download. are there users also have this problem ??
all other examples are running okay
-
- Posts: 444
- Joined: Mar 10, 2006 19:22
thank you Frank , yes it seems running okay, the example 99 picture like this http://postimage.org/image/2u7ay4nms/
i have windows xp /sp2 with nvidia geforce 7300 GT
i have windows xp /sp2 with nvidia geforce 7300 GT
-
- Posts: 444
- Joined: Mar 10, 2006 19:22
Hi,
Actually that doesn't look right, it should look more like this

Could you post an image of the Command Window that is underneath it so we can see the error messages. I really don't know much about the XEffects module though this is bitplanes work but I will see how I can help a Geforce 7300 shouldn't have any problems though.
Actually that doesn't look right, it should look more like this

Could you post an image of the Command Window that is underneath it so we can see the error messages. I really don't know much about the XEffects module though this is bitplanes work but I will see how I can help a Geforce 7300 shouldn't have any problems though.
Hi
i took pictures for 3 examples you may find it usefull:
ex 99
http://postimage.org/image/1fz7qb50/
ex 100
http://postimage.org/image/1gxy0lic/
ex 16:
http://postimage.org/image/1htd86w4/
in example 99 and 100 i have to close the graphics quickly so i got the beginning of the prompt messages since it is scrolling rapidly infinitely. i wonder how you got the picture of the graphics together with the prompt messages, since with me it is scrolling rapidly.
also testing the examples on windows 7 installed on the same machine i got the same error messages.
i took pictures for 3 examples you may find it usefull:
ex 99
http://postimage.org/image/1fz7qb50/
ex 100
http://postimage.org/image/1gxy0lic/
ex 16:
http://postimage.org/image/1htd86w4/
in example 99 and 100 i have to close the graphics quickly so i got the beginning of the prompt messages since it is scrolling rapidly infinitely. i wonder how you got the picture of the graphics together with the prompt messages, since with me it is scrolling rapidly.
also testing the examples on windows 7 installed on the same machine i got the same error messages.
-
- Posts: 444
- Joined: Mar 10, 2006 19:22
Hi,
I took a look on the XEffect website and it seams that some other people with a 7300 had similar problems this appears to be a OpenGL support issue. It did however work for them in DirectX. You can change to DirectX by changing IRR_EDT_OPENGL to IRR_EDT_DIRECT3D9 however not all builds of irrlichtwrapper are built for DirectX you can give it a go though.
You will also need to swap around the irrlicht.dll and irrlicht_ms.dll files and the same for the irrlichtwrapper ones too.
Example 16 seams to be working fine. You can grab a screenshot like mine by pressing alt while running this lets you grab the titlebar with the mouse and position the window where you want it, then just do a screenshot load it into the GIMP and clean it up.
Good luck.
P.S: thanks for the earlier post agamemnus, I hope your project is going well.
I took a look on the XEffect website and it seams that some other people with a 7300 had similar problems this appears to be a OpenGL support issue. It did however work for them in DirectX. You can change to DirectX by changing IRR_EDT_OPENGL to IRR_EDT_DIRECT3D9 however not all builds of irrlichtwrapper are built for DirectX you can give it a go though.
You will also need to swap around the irrlicht.dll and irrlicht_ms.dll files and the same for the irrlichtwrapper ones too.
Example 16 seams to be working fine. You can grab a screenshot like mine by pressing alt while running this lets you grab the titlebar with the mouse and position the window where you want it, then just do a screenshot load it into the GIMP and clean it up.
Good luck.
P.S: thanks for the earlier post agamemnus, I hope your project is going well.