Petr this is giving me the same error that example # 2 does. Eros's version worked but yours give this error. Hope it helps in finding what it could be. I don't see anything wrong:
Hi,
here is translation of Python ODE01.PY script to our precious ( thinBASIC )
thinBASIC source adds saving to file as bonus
[code=thinBASIC]
uses "FILE"
#include "thinbasic_ode.inc"
' -- Yes, to create new world is that easy
dim myWorld as dWorldID = dWorldCreate
' -- Creates generall body
dim myBody as dBodyID = dBodyCreate( myWorld )
' -- Here we will store mass
dim myMass AS dMass
' -- Planet Earth
dWorldSetGravity(myWorld, 0, -9.81, 0)
' -- Although it might seem like something else, we give DENSITY and RADIUS
dMassSetSphere( myMass, 2500.0, 0.05 )
' -- Here the actual mass
myMass.mass = 1
' -- Assign mass to body
dBodySetMass( myBody, myMass )
' -- Lets position mass at x, y, z
dBodySetPosition( myBody, 0, 2, 0 )
' -- May the Force be with our body
dBodyAddForce( myBody, 0, 200, 0 )
dim total_time as double
' -- Delta of time - 0.04 => like 25 FPS
dim dt as double = 0.04
' -- Variables to store position and speed
dim x, y, z, u, v, w AS dReal
dim fileOutput as string
while ( total_time < 2.0 )
ParseVector(dBodyGetPosition ( myBody ), x, y, z)
ParseVector(dBodyGetLinearVel ( myBody ), u, v, w)
fileoutput += FORMAT$( total_time, "0.00")+" sec: " + _
"pos=("+FORMAT$( x, "0.000")+","+FORMAT$( y, "0.000")+","+FORMAT$( z, "0.000")+")"+ _
"vel=("+FORMAT$( u, "0.000")+","+FORMAT$( v, "0.000")+","+FORMAT$( w, "0.000")+")"+$CRLF
dWorldStep( myworld, dt) ' -- Increases step in simulation
total_time +=dt
WEND
FILE_SAVE( APP_SOURCEPATH+"ODE_Output.txt", fileoutput )
' -- All created must be destroyed
dBodyDestroy( myBody )
dWorldDestroy( myWorld )
msgbox 0, "Script finished, results saved to ODE_Output.txt"
sub ParseVector( byval pointer as dword, byref b as SINGLE, byref c as single, byref d as single )
b = peek(single, pointer)
c = peek(single, pointer+4)
d = peek(single, pointer+
end sub
[/code]
I will try to translate even the 2 more examples, although I am not sure if they need callbacks yet.
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Petr this is giving me the same error that example # 2 does. Eros's version worked but yours give this error. Hope it helps in finding what it could be. I don't see anything wrong:
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Hi Kent,
this is simply the error in original headers I corrected yesterday
Just re-download latest header.
Thanks,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Hmmmm, I thought of that Petr and redownloaded it numerous times and cleared my cache and even saved to different folders, I still keep getting the same error.
Maybe my thinCore is messed up, I did some of the updates that Eros has last week or the week before and maybe didn't get the latest. I will redownload thinBasic and try again. Thanks.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks