Quote: "n3wton, could you post the source for your demo?"
Sorry it took awhile to get it, I wiped my laptop and have gone 64-bit so had to get it from my backup
here it is
sync on
sync rate 60
xeno start
rem Create Ground
make object box 1, 300, 1, 300
xeno make rigid body static box 1
Hide Object 1
Set Window Layout 0, 1, 0
Make Matrix 1, 300, 300, 50, 50
Load Image "Grass.png", 1
Prepare Matrix Texture 1, 1, 1, 1
Position Matrix 1, -150, 0.45, -150
Update Matrix 1
Load Image "Planks.jpg", 2
Make Object Box 101, 40, 40, 10
Position Object 101, 50, -17, 5
Texture Object 101, 2
Scale Object Texture 101, 8, 8
zrotate Object 101, 30
Xeno Make Rigid Body Static Box 101
Set Shadow Shading On 101
for x = 1000 to 1100
Make Object cube x, 1
Color Object x, rgb(rnd(255), rnd(255), rnd(255))
Position Object x, -150+rnd(300), 20+rnd(30), -150+rnd(300)
Xeno Make Rigid Body Dynamic Box x
next x
Position Light 0, 50, 100, 50
Load Object "Car.x", 22
Load Image "Car.dds", 22
Texture Object 22, 22
Rotate Limb 22, 0, 0, -90, 0
Set Shadow Shading On 22, -1, 1000, 1
make object box 2, 4.5, 1, 2.6
Hide Object 2
color object 2, rgb(0, 40, 128)
xeno make rigid body dynamic box 2
xeno set rigid body position 2, 0, 10, 5
Xeno Set Rigid Body Mass 2, 1200
xeno make vehicle 2, 2
xeno make camera 2, 2
ObjectsMade = 100
dim help(4) as string
help(1) = "WASD - Control Vehicle"
help(2) = "Spacekey - Handbrake"
help(3) = "Returnkey - Add 100 Boxes"
help(4) = "F1 - Hide Help"
ShowHelp = 1
direction = 0
do
xeno update
Text 0, 0, "FPS : " +Str$(Screen FPS())
Text 0, 14, "POLYGONS : "+Str$(Statistic(1))
Text 0, 28, "BOXES MADE : "+Str$(ObjectsMade)
if ShowHelp = 1
for x = 1 to 4
Text 0, 56+(14*x), Help(x)
next x
endif
if keystate(59)
While Keystate(59)
endWhile
ShowHelp = abs(ShowHelp-1)
endif
velocity# = sqrt( (Xeno Get Rigid Body Linear Velocity X(2)^2) + (Xeno Get Rigid Body Linear Velocity Z(2)^2) )
text 0, 42, Str$(velocity#, 0) + " MPH"
spin# = (spin# - ((velocity#*0.25)*direction))
if keystate(17)
direction = 1
xeno vehicle accelerate 2, -10
endif
if keystate(31)
direction = -1
xeno vehicle accelerate 2, 6
endif
turnval = 0
if keystate(30)
xeno vehicle turn 2, 6
turnval = -40
endif
if keystate(32)
xeno vehicle turn 2, -6
turnval = 40
endif
if spacekey()
xeno vehicle hand brake 2
spin = 0
endif
Rotate Limb 22, 2, spin#, turnval, 0
Rotate Limb 22, 3, spin#, 0, 0
Rotate Limb 22, 4, spin#, turnval, 0
Rotate Limb 22, 5, spin#, 0, 0
if returnkey()
While ReturnKey()
endWhile
for x = 0 to 100
fo = Find Free Object()
Make Object cube fo, 1
Color Object fo, rgb(rnd(255), rnd(255), rnd(255))
Position Object fo, -150+rnd(300), 20+rnd(30), -150+rnd(300)
Xeno Make Rigid Body Dynamic Box fo
next x
ObjectsMade = ObjectsMade + 100
endif
Position Object 22, Object Position X(2), Object Position Y(2)-0.8, Object Position Z(2)
Rotate Object 22, Object Angle X(2), Object Angle Y(2)-0.8, Object Angle Z(2)
cameraX# = xeno get camera position x(2)
cameraY# = xeno get camera position y(2)
cameraZ# = xeno get camera position z(2)
px# = xeno get camera point x(2)
py# = xeno get camera point y(2)
pz# = xeno get camera point z(2)
position camera cameraX#, cameraY#, cameraZ#
point camera px#, py#, pz#
Move Camera -4
sync
loop
not the nicest of code, I'll probably rewrite it and make some functions if i can be bothered
yours
N3wton