Ask the easy ones, why don't you?
Ok, I can't help you with the modelling itself - I have almost no modelling ability at all. You're on your own there.
One thing I have worked on though is making things a lot easier to do or to get at, and one of those things is the creation and manipulation of objects and limbs. You'll find all sorts of commands in my plug-ins that, with a little experience, will make things easier.
You'll need to install my plug-ins (link in my signature) to compile and run this code:
sync on
sync rate 60
autocam off
dot 0, 0, rgb(255, 0, 0)
get image 1, 0, 0, 1, 1
dot 0, 0, rgb(0, 255, 0)
get image 2, 0, 0, 1, 1
dot 0, 0, rgb(0, 0, 255)
get image 3, 0, 0, 1, 1
dot 0, 0, rgb(255, 255, 0)
get image 4, 0, 0, 1, 1
make object cube 1, 1.0
rotate object 1, 45.0, 0.0, 45.0
make mesh from object 1, 1
delete object 1
BEGIN NEW OBJECT
` Top Triangle, red
ADD NEW LIMB 3, 0, 274, 0
SET NEW LIMB NAME "T0"
SET NEW LIMB TEXTURE 1
SET NEW LIMB CULL 0
` Pivot limb
Pivot = ADD NEW LIMB()
SET NEW LIMB NAME "Pivot"
SET NEW LIMB OFFSET 0.0, -1.0, 0.0
` Middle-bottom triangle - untextured, culled
Limb = ADD NEW LIMB(3, 0, 274, 0)
SET NEW LIMB NAME "T1"
SET NEW LIMB ROTATION 0.0, 180.0, 0.0
SET NEW LIMB PARENT Pivot
SET NEW LIMB CULL 1
` Right-bottom triangle, green
ADD NEW LIMB 3, 0, 274, 0
SET NEW LIMB NAME "T2"
SET NEW LIMB OFFSET 1.0, 0.0, 0.2
SET NEW LIMB TEXTURE 2
SET NEW LIMB PARENT Limb
SET NEW LIMB CULL 0
` Left-bottom triangle, blue, not affected by lights
ADD NEW LIMB 3, 0, 274, 0
SET NEW LIMB NAME "T3"
SET NEW LIMB OFFSET -1.0, 0.0, -0.2
SET NEW LIMB TEXTURE 3
SET NEW LIMB PARENT Limb
SET NEW LIMB CULL 0
SET NEW LIMB TRANSPARENT 1
SET NEW LIMB LIGHT 0
` Bottom cube, yellow, generated from mesh data
ADD NEW LIMB FROM MESH 1
SET NEW LIMB NAME "CUBE"
SET NEW LIMB OFFSET 0.0, -1.0, 0.0
SET NEW LIMB PARENT Limb
SET NEW LIMB CULL 0
SET NEW LIMB TEXTURE 4
FINISH NEW OBJECT 1
` Set vertex data for all limbs that have a name starting with 'T'
for Limb = 0 to get limb count(1)
lock vertexdata for limb 1, Limb
if left$( limb name$(1, Limb), 1 ) = "T"
set vertexdata position 0, -1.0, 0.0, 0.0
set vertexdata normals 0, 0.0, 0.0, 1.0
set vertexdata position 1, 1.0, 0.0, 0.0
set vertexdata normals 1, 0.0, 0.0, 1.0
set vertexdata position 2, 0.0, 1.0, 0.0
set vertexdata normals 2, 0.0, 0.0, 1.0
endif
unlock vertexdata
next
color backdrop rgb(0, 0, 0)
move camera -4.0
move camera down 0.5
do
set cursor 0, 0
for i = 0 to get limb count(1)
print i; " -> "; padright$(limb name$(1, i), 10);
print " - Parent = "; num(get limb parent(1, i), 2);
print ", Child = "; num(get limb child(1, i), 2);
print ", Sibling = "; num(get limb sibling(1, i), 2)
next
print ""
DisplayLimbStructure(1)
yrotate object 1, wrapvalue(object angle y(1) + 1.5)
rotate limb 1, get limb by name(1, "Pivot"), 0.0, object angle y(1), 0.0
rotate limb 1, get limb by name(1, "Cube"), 0.0, wrapvalue(object angle y(1) * -3.0), 0.0
sync
loop
function Num(v as integer, Size as integer)
local Result as string
if v < 0
Result = padleft$("*", Size)
else
Result = padleft$(str$(v), Size)
endif
endfunction Result
function DisplayLimbStructure(Object as integer)
DisplayLimbStructureDetail(Object, 0, 0)
endfunction
function DisplayLimbStructureDetail(Object as integer, Limb as integer, Indent as integer)
if Limb < 0 then exitfunction
print space$(Indent), Limb, " - ", limb name$(Object, Limb)
DisplayLimbStructureDetail(Object, get limb child(Object, Limb), Indent + 2)
DisplayLimbStructureDetail(Object, get limb sibling(Object, Limb), Indent)
endfunction
Run the code first and see how it builds up a hierarchy of limbs into a new object.
Notice how it sets up a name for each limb, and associates various limbs with a another limb as a parent - it basically builds up a tree structure. You are responsible for setting up an equivalent structure in the same way in your modelling package and naming the 'interesting' limbs, ie the ones you want to manipulate.
Next, take a look at the main loop, in particular lines 103 & 104. You'll see that I'm not using a limb number, but instead telling DBPro to find a limb using a name instead (using another of my functions). That's how I advise you to do it. That way, when your limb numbering changes because you modified your object, you don't need to go back through your code to correct those limb numbers.
The last thing is that each limb can have a parent and several children. Those children are related to each other as siblings. I have provided 3 functions that allow you to query the parent, first child and first sibling of each limb. I use those functions in the last 2 functions within the code to display the indented text description of the limb structure. Each of those functions will return -1 if there is no parent/child/sibling for the specified limb.
For example, you may have limb 0 as the top level limb, and limbs 1 and 2 have it set as a parent. You should expect to see the following relationships between them:
- Limb 0 - No parent, no sibling, child is limb 1
- Limb 1 - Parent is limb 0, Sibling is limb 2, no child
- Limb 2 - Parent is limb 0, no sibling, no child
Now there's a lot of code there that you might have a problem understanding - just stick to the bits I've pointed out and you'll be Ok, until you are ready for the rest.