Ooops.
Function Vertices(ObjNo)
`Returns number of Vertices
`Vars
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make your meshes and memblocks
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
`Tidy
delete memblock 1
endfunction NoVerts
Function VertexX(ObjNo,VertexNo)
`Returns X position of specified vertex
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make Memblock
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
If VertexNo<NoVerts
`Get values of vertex cords
ValueX#=memblock float(1,12+((VertexNo*36)-36))
endif
`Tidy Up
delete memblock 1
endfunction ValueX#
Function VertexY(ObjNo,VertexNo)
`Returns Y position of specified vertex
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make Memblock
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
If VertexNo<NoVerts
`Get values of vertex cords
ValueY#=memblock float(1,12+((VertexNo*36)-32))
endif
`Tidy Up
delete memblock 1
endfunction ValueY#
Function VertexZ(ObjNo,VertexNo)
`Returns Z position of specified vertex
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make Memblock
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
If VertexNo<NoVerts
`Get values of vertex cords
ValueZ#=memblock float(1,12+((VertexNo*36)-28))
endif
`Tidy Up
delete memblock 1
endfunction ValueZ#
Function Position_Vertex(ObjNo,VertexNo,X#,Y#,Z#)
`Moves the Vertex
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make Memblock
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
If VertexNo<NoVerts
`Get values of vertex cords
write memblock float 1,12+((VertexNo*36)-36),X#
write memblock float 1,12+((VertexNo*36)-32),Y#
write memblock float 1,12+((VertexNo*36)-28),Z#
`Change the mesh
change mesh from memblock MeshNo,1
endif
`Tidy Up
change mesh ObjNo,0,MeshNo
delete memblock 1
endfunction
Function Amend_Vertex_Normals(ObjNo,VertexNo,X#,Y#,Z#)
`Amends the Normals Data of the vertex
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make Memblock
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
If VertexNo<NoVerts
`Get values of vertex cords
write memblock float 1,12+((VertexNo*36)-24),X#
write memblock float 1,12+((VertexNo*36)-20),Y#
write memblock float 1,12+((VertexNo*36)-16),Z#
`Change the mesh
change mesh from memblock MeshNo,1
endif
`Tidy Up
change mesh ObjNo,0,MeshNo
delete memblock 1
endfunction
Function Amend_Vertex_Diffuse(ObjNo,VertexNo,Diff)
`Amends the Diffuse Colour of the vertex
MeshNo=100
make mesh from object MeshNo,ObjNo
NoVerts=0
`Make Memblock
make memblock from mesh 1,MeshNo
`Calculate no of vertices
NoVerts=memblock dword(1,8)
If VertexNo<NoVerts
`Get values of vertex cords
write memblock dword 1,12+((VertexNo*36)-12),Diff
`Change the mesh
change mesh from memblock MeshNo,1
endif
`Tidy Up
change mesh ObjNo,0,MeshNo
delete memblock 1
endfunction