@Star Vitebsk
Is that what you want?
`FLUSH VIDEO MEMORY
SYNC ON:SYNC RATE 30
height=640
weight=480
height2=height/2:weight2=weight/2: SET DISPLAY MODE height,weight,32
COLOR BACKDROP RGB(0,0,0):BACKDROP ON: CLS: SET TEXT FONT "AriaL",204:SET TEXT SIZE 18:INK RGB(255,255,255),RGB(0,0,0)
POSITION MOUSE height2,weight2:HIDE MOUSE
#constant FVF_XYZ = 0x002
#constant FVF_XYZRHW = 0x004
#constant FVF_NORMAL = 0x010
#constant FVF_PSIZE = 0x020
#constant FVF_DIFFUSE = 0x040
#constant FVF_SPECULAR = 0x080
#constant FVF_TEX0 = 0x000
#constant FVF_TEX1 = 0x100
#constant FVF_TEX2 = 0x200
#constant FVF_TEX3 = 0x300
#constant FVF_TEX4 = 0x400
#constant FVF_TEX5 = 0x500
#constant FVF_TEX6 = 0x600
#constant FVF_TEX7 = 0x700
#constant FVF_TEX8 = 0x800
for i=1 to 4:make object sphere 15+i, 3: color object 15+i,rgb(255,0,0):next i
position object 15+1, 10,0,10
position object 15+2, 10,0,20
position object 15+3, 30,0,20
position object 15+4, 30,0,10
BuildObjectFromData(10)
`offset limb 10,0,20,0,30
make object box 20,20,10,10:position object 20,20,0,30
`Center X-Y-Z = 0-0-0
make object sphere 1,3:color object 1,rgb(0,0,255)
position object 1,0,0,0
position camera 0,90,0:point camera 0,0,0
do
set cursor 0,0: print screen fps()
print "object 10"
print "size x=";object size x(10)
print "size y=";object size y(10)
print "size z=";object size z(10)
print
print "object 20"
print "size x=";object size x(20)
print "size y=";object size y(20)
print "size z=";object size z(20)
yrotate object 10,object angle y(10)+1
yrotate object 20,object angle y(20)+1
sync
loop
end
offset limb 20,0,-50,0,0
function BuildObjectFromData(Object as integer)
restore ObjectData
local Vertices as integer
local Indices as integer
local Diffuse as dword
local Index as integer
local x as float
local y as float
local z as float
local nx as float
local ny as float
local nz as float
local i as integer
read Vertices
read Indices
make object new Object, Vertices, Indices, FVF_XYZ || FVF_NORMAL || FVF_DIFFUSE
lock vertexdata for limb Object, 0
for i = 0 to Vertices-1
read nx, ny, nz:
read Diffuse
if i=0 then x7#=object position x(15+1): y7#=-1: z7#=object position z(15+1)
if i=1 then x7#=object position x(15+1): y7#=1: z7#=object position z(15+1)
if i=2 then x7#=object position x(15+4): y7#=1 : z7#=object position z(15+4)
if i=3 then x7#=object position x(15+4): y7#=-1: z7#=object position z(15+4)
if i=4 then x7#=object position x(15+2): y7#=-1: z7#=object position z(15+2)
if i=5 then x7#=object position x(15+2): y7#=1 : z7#=object position z(15+2)
if i=6 then x7#=object position x(15+3): y7#=1 : z7#=object position z(15+3)
if i=7 then x7#=object position x(15+3): y7#=-1: z7#=object position z(15+3)
if i=8 then x7#=object position x(15+1): y7#=-1: z7#=object position z(15+1)
if i=9 then x7#=object position x(15+1): y7#=1 : z7#=object position z(15+1)
if i=10 then x7#=object position x(15+2): y7#=-1: z7#=object position z(15+2)
if i=11 then x7#=object position x(15+2): y7#=1: z7#=object position z(15+2)
if i=12 then x7#=object position x(15+4): y7#=-1: z7#=object position z(15+4)
if i=13 then x7#=object position x(15+4): y7#=1: z7#=object position z(15+4)
if i=14 then x7#=object position x(15+3): y7#=-1: z7#=object position z(15+3)
if i=15 then x7#=object position x(15+3): y7#=1: z7#=object position z(15+3)
if i=16 then x7#=object position x(15+1): y7#=1: z7#=object position z(15+1)
if i=17 then x7#=object position x(15+4): y7#=1: z7#=object position z(15+4)
if i=18 then x7#=object position x(15+2): y7#=1: z7#=object position z(15+2)
if i=19 then x7#=object position x(15+3): y7#=1: z7#=object position z(15+3)
if i=20 then x7#=object position x(15+1): y7#=-1: z7#=object position z(15+1)
if i=21 then x7#=object position x(15+4): y7#=-1: z7#=object position z(15+4)
if i=22 then x7#=object position x(15+2): y7#=-1: z7#=object position z(15+2)
if i=23 then x7#=object position x(15+3): y7#=-1: z7#=object position z(15+3)
yyyH=y7#*10*0.5
set vertexdata position i, x7#, yyyH, z7#
set vertexdata normals i, nx, ny, nz
set vertexdata diffuse i, Diffuse
next i
for i = 0 to Indices-1
read Index
set indexdata i, Index
next i
offset limb 10,0,-20,0,-15
unlock vertexdata
endfunction
`-----------------------------------------------------------------------------------------
ObjectData:
data 24, 36 ` 24 vertices, 36 indices
` Vertex data
` nx ny nz diffuse
data 0, 0, -1, 0x00000000
data 0, 0, -1, 0x00000000
data 0, 0, -1, 0x00000000
data 0, 0, -1, 0x00000000
data 0, 0, 1, 0x00000000
data 0, 0, 1, 0x00000000
data 0, 0, 1, 0x00000000
data 0, 0, 1, 0x00000000
data -1, 0, 0, 0x00000000
data -1, 0, 0, 0x00000000
data -1, 0, 0, 0x00000000
data -1, 0, 0, 0x00000000
data 1, 0, 0, 0x00000000
data 1, 0, 0, 0x00000000
data 1, 0, 0, 0x00000000
data 1, 0, 0, 0x00000000
data 0, 1, 0, 0x00ff0000
data 0, 1, 0, 0x0000ff00
data 0, 1, 0, 0x000000ff
data 0, 1, 0, 0x00000000
data 0, -1, 0, 0x00000000
data 0, -1, 0, 0x00000000
data 0, -1, 0, 0x00000000
data 0, -1, 0, 0x00000000
` Index data
data 0, 1, 2, 0, 2, 3
data 4, 6, 5, 4, 7, 6
data 8, 10, 9, 9, 10, 11
data 12, 13, 14, 14, 13, 15
data 16, 19, 17, 16, 18, 19
data 20, 21, 22, 21, 23, 22
I'm not a grumpy grandpa
