Hey, that's an awesome Santa, Sven!
I'm using a very similar method for generating my objects as well.
Here's a sleigh I've been working on... (Still haven't put the present file in yet...)
` Screen settings
sync on : sync rate 60
backdrop on : color backdrop rgb(0, 32, 128)
autocam off
set image colorkey 255, 0, 255
` Make the player sleigh
player = BuildSleigh()
position object player, 0, 0, 0
set object transparency player, 4
` Position the camera
position camera 0, 0, -50
point camera 0, 0, 0
` Main loop
do
set cursor 0, 0
print screen fps()
yrotate object player, wrapvalue(object angle y(player) + 0.5)
sync
loop
` ***********************
` *** Sleigh Creation ***
` ***********************
` Build the player sleigh object
function BuildSleigh()
` Find object index that sleigh will use
obj = FreeObject()
` ** Sleigh Bottom (Root) **
` Make floor
make object plain obj, 30, 20, 1
rotate object obj, 270, 0, 0
fix object pivot obj
` Push floor down
offset limb obj, sleighBottom, 0, 0, -10
` ** Prepare to add limbs **
temp = FreeObject()
mesh = FreeMesh()
` ** Sleigh Left Side **
` Make side
make object plain temp, 30, 20, 1
rotate object temp, 270, 180, 0
fix object pivot temp
` Push to the left
offset limb temp, 0, 0, 8.9, -10
` Add limb
make mesh from object mesh, temp
add limb obj, sleighSideL, mesh
link limb obj, sleighBottom, sleighSideL
` Cleanup
delete object temp
delete mesh mesh
` ** Sleigh Right Side **
` Make side
make object plain temp, 30, 20, 1
rotate object temp, 90, 0, 0
fix object pivot temp
` Push to the right
offset limb temp, 0, 0, 8.9, -10
` Add limb
make mesh from object mesh, temp
add limb obj, sleighSideR, mesh
link limb obj, sleighBottom, sleighSideR
` Cleanup
delete object temp
delete mesh mesh
` ** Sleigh Back **
` Make back
make object plain temp, 20, 20
rotate object temp, 90, 0, 90
fix object pivot temp
` Push to the back
offset limb temp, 0, 0, 8.9, -14.9
` Add limb
make mesh from object mesh, temp
add limb obj, sleighBack, mesh
link limb obj, sleighBottom, sleighBack
` Cleanup
delete object temp
delete mesh mesh
` ** Sleigh Front **
` Make front
make object plain temp, 20, 20
rotate object temp, 90, 0, 270
fix object pivot temp
` Push to the front
`offset limb temp, 0, 0, 0, -14.9
offset limb temp, 0, 0, 8.9, -14.9
` Add limb
make mesh from object mesh, temp
add limb obj, sleighFront, mesh
link limb obj, sleighBottom, sleighFront
` Cleanup
delete object temp
delete mesh mesh
` ** Left Blade **
` Make blade
make object plain temp, 50, 5, 1
rotate object temp, 270, 180, 0
fix object pivot temp
` Push to the left
offset limb temp, 0, 5, -2.5, -10.1
` Add limb
make mesh from object mesh, temp
add limb obj, sleighBladeL, mesh
link limb obj, sleighBottom, sleighBladeL
` Cleanup
delete object temp
delete mesh mesh
` ** Right Blade **
` Make blade
make object plain temp, 50, 5, 1
rotate object temp, 90, 0, 0
fix object pivot temp
` Push to the right
offset limb temp, 0, -5, -2.5, -10.1
` Add limb
make mesh from object mesh, temp
add limb obj, sleighBladeR, mesh
link limb obj, sleighBottom, sleighBladeR
` Cleanup
delete object temp
delete mesh mesh
` ** Toy Sack **
` Make sack
make object sphere temp, 20, 10, 10
scale object temp, 70, 95, 120
rotate object temp, 350, 345, 0
` Push to the back and into the sleigh
offset limb temp, 0, -5, -2, 10
` Add limb
make mesh from object mesh, temp
add limb obj, sleighSack, mesh
link limb obj, sleighBottom, sleighSack
` Cleanup
delete object temp
delete mesh mesh
` ** Toy Sack Top **
` Make cone
make object cone temp, 10
scale object temp, 50, 100, 50
rotate object temp, 250, 320, 0
` Push to the top of the sack
offset limb temp, 0, 10, -23, -7
` Add limb
make mesh from object mesh, temp
add limb obj, sleighSackTop, mesh
link limb obj, sleighSack, sleighSackTop
` Cleanup
delete object temp
delete mesh mesh
` ** Textures **
gosub MakeSleighTextures
texture limb obj, sleighBottom, sleighFloorImg
texture limb obj, sleighSideL, sleighLeftImg
texture limb obj, sleighSideR, sleighRightImg
texture limb obj, sleighBack, sleighBackImg
texture limb obj, sleighFront, sleighFrontImg
texture limb obj, sleighBladeL, sleighBladeLImg
texture limb obj, sleighBladeR, sleighBladeRImg
texture limb obj, sleighSack, sleighSackImg
texture limb obj, sleighSackTop, sleighSackImg
set object cull obj, 0
endfunction obj
` Generate the textures to use for player sleigh
MakeSleighTextures:
` ** Floor texture **
create bitmap 1, 2, 2
` Red background
ink rgb(200, 0, 0), 0
box 0, 0, 2, 2
` Store image
global sleighFloorImg : sleighFloorImg = FreeImage()
get image sleighFloorImg, 0, 0, 2, 2
delete bitmap 1
` ** Right texture **
create bitmap 1, 150, 100
` Red background
ink rgb(200, 0, 0), 0
box 0, 0, 150, 100
` Use a sine wave to add detail
for x = 0 to 150
y = (sin((x*1.7)-80)*40)+40
` Add a white stripe along the wave
ink rgb(255, 255, 255), 0
line x, y, x, y+10
line x, y+13, x, y+14
` Fill in the area above the stripe with pink (transparent)
ink rgb(255, 0, 255), 0
line x, 0, x, y
` Make the bottom edge of the sleigh rounded
y = (sin(x*1.2)*6)+95
line x, y, x, 100
next x
` Store image
global sleighRightImg : sleighRightImg = FreeImage()
get image sleighRightImg, 0, 0, 150, 100
` ** Left texture **
create bitmap 2, 150, 100
` (Mirror image of right side texture)
copy bitmap 1, 2
mirror bitmap 2
set current bitmap 2
` Store image
global sleighLeftImg : sleighLeftImg = FreeImage()
get image sleighLeftImg, 0, 0, 150, 100
delete bitmap 2
delete bitmap 1
` ** Back texture **
create bitmap 1, 100, 100
` Red background
ink rgb(200, 0, 0), 0
box 0, 0, 100, 100
` Add a white stripe along the top
ink rgb(255, 255, 255), 0
box 0, 0, 100, 10
box 0, 13, 100, 15
` Make the bottom edge pink (transparent)
ink rgb(255, 0, 255), 0
box 0, 95, 100, 100
` Store image
global sleighBackImg : sleighBackImg = FreeImage()
get image sleighBackImg, 0, 0, 100, 100
delete bitmap 1
` ** Front texture **
create bitmap 1, 100, 100
` Red background
ink rgb(200, 0, 0), 0
box 0, 0, 100, 100
` Add a white stripe along the middle
ink rgb(255, 255, 255), 0
box 0, 45, 100, 55
box 0, 57, 100, 59
` Make the top half pink (transparent)
ink rgb(255, 0, 255), 0
box 0, 0, 100, 45
` Make the bottom edge transparent
box 0, 95, 100, 100
` Store image
global sleighFrontImg : sleighFrontImg = FreeImage()
get image sleighFrontImg, 0, 0, 100, 100
delete bitmap 1
` ** Left blade texture **
create bitmap 1, 250, 25
` Pink (transparent) background
ink rgb(255, 0, 255), 0
box 0, 0, 250, 25
` Add track along the bottom
ink rgb(160, 160, 160), 0
box 12, 20, 212, 25
` Add front curve
for a = 90 to 270
x = (cos(a)*10)+12 : y = (sin(a)*10)+12
box x, y, x+5, y+5
next a
` Add back curve
for a = -90 to 90
x = (cos(a)*10)+205 : y = (sin(a)*10)+12
box x, y, x+5, y+5
next a
` Add vertical bars along the track
for i = 1 to 5
box i*30, 0, (i*30)+5, 25
next i
` Store image
global sleighBladeLImg : sleighBladeLImg = FreeImage()
get image sleighBladeLImg, 0, 0, 250, 25
` ** Right blade texture **
create bitmap 2, 250, 25
` (Mirror image of left blade texture)
copy bitmap 1, 2
mirror bitmap 2
set current bitmap 2
` Store image
global sleighBladeRImg : sleighBladeRImg = FreeImage()
get image sleighBladeRImg, 0, 0, 250, 25
delete bitmap 2
delete bitmap 1
` ** Sack texture **
create bitmap 1, 2, 2
` Gray-green background
ink rgb(80, 100, 80), 0
box 0, 0, 2, 2
` Store image
global sleighSackImg : sleighSackImg = FreeImage()
get image sleighSackImg, 0, 0, 2, 2
delete bitmap 1
return
` ***********************
` *** Misc. functions ***
` ***********************
` Find a free image index
function FreeImage()
repeat
inc n
until image exist(n) = 0
endfunction n
` Find a free object index
function FreeObject()
repeat
inc n
until object exist(n) = 0
endfunction n
` Find a free mesh index
function FreeMesh()
repeat
inc n
until mesh exist(n) = 0
endfunction n
` *****************
` *** Constants ***
` *****************
` Sleigh object limb numbers
#constant sleighFloor 0
#constant sleighSideL 1
#constant sleighSideR 2
#constant sleighBack 3
#constant sleighFront 4
#constant sleighBladeL 5
#constant sleighBladeR 6
#constant sleighSack 7
#constant sleighSackTop 8