Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / link limbs in chain sequence?

Author
Message
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 31st Dec 2006 09:27
Can anyone tell me what's wrong with my sequence?

I have spent 8 hours trying to fix this problem but I really don't know. I've looked at almost every help file I could find but none specify my situation.

I was trying to make a man or figure out of linbs but there are a lot of errors. A sphere for a head. A big cylinder for chest area. Eight limbs for 2 upper arms,2 arms, 2 upper legs, and 2 legs.

what is wrong.

I really hope this gets posted and replied.

heres all my code so far.


Sync On:Sync Rate 60:AutoCam Off

make object cylinder 1,20
make mesh from object 1,1
for m=2 to 9
make object cylinder m,15
make mesh from object m,m
next m
Make Object sphere 10,10
Make Mesh From Object 10,10
for g=11 to 19
Make Object sphere g,1
make mesh from object g,g
next g

add limb 11,11,11
add limb 12,12,12
add limb 14,14,14
add limb 13,13,13
add limb 15,15,15
add limb 16,16,16
add limb 18,18,18
add limb 17,17,17
add limb 19,19,19

Offset Limb 1,1,0,8,0
Offset Limb 2,2,0,7.5,0
Offset Limb 3,3,0,7.5,0
Offset Limb 4,4,0,7.5,0
Offset Limb 5,5,0,7.5,0
Offset Limb 6,6,0,7.5,0
Offset Limb 7,7,0,7.5,0
Offset Limb 8,8,0,7.5,0
Offset Limb 9,9,0,7.5,0
Offset Limb 10,10,0,-5,0

glue object to limb 11,10,10
glue object to limb 12,2,1
glue object to limb 13,3,1
glue object to limb 14,4,2
glue object to limb 15,5,3
glue object to limb 16,6,1
glue object to limb 17,7,1
glue object to limb 18,8,8
glue object to limb 19,9,9


Position Object 1,0,0,50
wait key
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 1st Jan 2007 01:54
This could give you an idea
press n to rotate cam around the character

Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 1st Jan 2007 01:54
There are several reasons why this does not work.
1.The first number in the add limb command is the object you are attaching the limb to. The second number is the number the limb will be on the object. You have to attach limbs in order starting from 1. For example this
should be

2.The first number of the offset limb command is also the number of the object the limb is attached to so this
should be

3.
is unnecesary


So you end up with this
and no more error messages
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 2nd Jan 2007 06:07
OK, I have a feeling this reformed code can work but for some reason it doen't appear or respond to wait key.

for add limb:
1. first is the object the limb is in.
2. the limb # in the object (starting from 1, then restarting after different objects with limbs)
3. mesh # of the new limb

for offset limb:
1. first is the object the limb is in.
2. the limb # in the object (starting from 1, then restarting after different objects with limbs)
3. 4. and 5. the distance the limb is from the middle of the object

for glue object to limb:
1. first is the object the limb is in.
2. the limb # in the object (starting from 1, then restarting after different objects with limbs)
3. the object # of the object stuck to the limb

I erased all the other meshes except for the spheres because it was unnecessary.

I was trying to make a man or figure out of linbs but there are a lot of errors. A sphere for a head. A big cylinder for chest area. Eight limbs for 2 upper arms,2 arms, 2 upper legs, and 2 legs.
Using the spheres for pivots for the arms/cylinders. I'm using the spheres for joints. Remember I'm trying to make a man without buying other darkbasic products. I appreciate any help.

scorpio: your code is very helpful for later problems that I will come to.

jerok: I switched the #'s around but I need to keep the glue because I need pivots for the arms and legs instead of his arms spinning using the middle pivot.


Sync On:sync rate 0:AutoCam Off

make object cylinder 1,20
for m=2 to 9
make object cylinder m,15
next m
Make Object sphere 10,10
for g=11 to 19
Make Object sphere g,1
make mesh from object g,g
hide object g
next g

add limb 1,1,11
add limb 1,2,12
add limb 1,3,13
add limb 1,4,16
add limb 1,5,17
add limb 2,1,14
add limb 3,1,15
add limb 6,1,18
add limb 7,1,19

Offset Limb 1,1,0,10,0
Offset Limb 1,2,-5,8,0
Offset Limb 1,3,5,8,0
Offset Limb 1,4,0,7.5,0
Offset Limb 1,5,0,7.5,0
Offset Limb 2,1,0,-7.5,0
Offset Limb 3,1,0,-7.5,0
Offset Limb 6,1,0,-7.5,0
Offset Limb 7,1,0,-7.5,0

glue object to limb 1,1,10
glue object to limb 1,2,2
glue object to limb 1,3,3
glue object to limb 1,4,6
glue object to limb 1,5,7
glue object to limb 2,1,4
glue object to limb 3,1,5
glue object to limb 6,1,8
glue object to limb 7,1,9

wait key
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 2nd Jan 2007 20:10 Edited at: 2nd Jan 2007 20:14
i still believe that the glue object to limb command is unnecesary for this but since you insist: when using the glue object command the numbers go the object you are glueing,the object the limb is attached to,limb number so this
should be


also since you are not using a loop
is unnecesary and causes problems

now when you run the code you see a blank blue screen so now you have to position the camera behind the object and point it at the object with


and now you are left with


edit: to create characters you dont need to buy another program there are several free modelers you can download that are very good. such ashttp://www.blender.org/cms/Home.2.0.html
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 2nd Jan 2007 23:05
1. Is there any way to specify where the object is glued to the limb-like x,y,z?

and

2. Is there a way an object can have a limb that has its pivot point in another spot other than the first object's pivot?
if so, can I have multiple pivot points inside the first object?

This joint-making code is not connecting the arm parts or the leg parts.
It points to the strange sphere in the middle of the chest area when I change the object it's pointing to, but if I make that same object # turn then the right object turns. Very discouraging.



AutoCam Off
sync on

make object cylinder 1,20
position object 1,0,0,0
for m=2 to 9
make object cylinder m,5
next m
Make Object sphere 10,10
for g=11 to 19
Make Object sphere g,1
make mesh from object g,g
next g

add limb 1,1,11
add limb 1,2,12
add limb 1,3,13
add limb 1,4,16
add limb 1,5,17
add limb 2,1,14
add limb 3,1,15
add limb 6,1,18
add limb 7,1,19

Offset Limb 1,1,0,20,0
Offset Limb 1,2,-5,8,0
Offset Limb 1,3,5,8,0
Offset Limb 1,4,-5,-8,0
Offset Limb 1,5,5,-8,0
Offset Limb 2,1,0,-2.5,0
Offset Limb 3,1,0,-2.5,0
Offset Limb 6,1,0,-2.5,0
Offset Limb 7,1,0,-2.5,0

glue object to limb 10,1,1
glue object to limb 2,1,2
glue object to limb 3,1,3
glue object to limb 6,1,4
glue object to limb 7,1,5
glue object to limb 4,2,1
glue object to limb 5,3,1
glue object to limb 8,6,1
glue object to limb 9,7,1

position camera 0,-10,-10
point camera object position x(10),object position y(10),object position z(10)
do
turn object left 1,2
sync
loop
wait key
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 3rd Jan 2007 19:48 Edited at: 3rd Jan 2007 19:49
The spheres in the middle are the limbs when you create a limb it takes on the object the mesh was created from which is why I said the glue object command was unnecesary. When I scaled down the chest object some and changed the cull it looks okay but i dont know how to answer eigther of your questions I still reccomend downloading a free modeler like the one I posted a link to in my above post because you will be able to make much better looking characters and organize your limbs for animation in a much better way. There are several tutorials around the 3d chat board and I'm sure you will find many more through google.

Anyway here's your code with the minor changes I made
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 3rd Jan 2007 23:03 Edited at: 3rd Jan 2007 23:32
I think there is some confusion here in building complex objects from other
objects.

The proper way is as follows:

1. The Limbs

You have a couple choices here. You can either load all the objects from files, or
create them with the primitive object commands within the DarkBASIC language.

In order to build the model with limbs, the limbs must be converted to, or loaded as a mesh.
The following commands are suited for this operation:

make mesh from object mesh number, object number or
load mesh "filename", mesh number

This depends on what you want to do with the limbs first.

There are cases where you need to load them in as an object and then convert them later.
Why? Well, you may need to re-orient the object intended to be a limb before adding them
to it's parent object. This may also be the case with primitives created within the
code as well.

Re-orientation:

xrotate object object number, x angle value and/or
yrotate object object number, y angle value and/or
zrotate object object number, z angle value and/or

fix object pivot object number

then

make mesh from object mesh number, object number

Note: Upon converting objects with textures to a mesh, the texture data will
be stripped from the geometry. You will need to re-texture it.

2. The Object And It's Hierarchy

An object which has limbs is considered the parent or root, and the limbs are
it's children. In order to build a model of this sort, you mush select the
meshes and add them to the parent object. This is done with the ADD LIMB command.
This command only tells DarkBasic which meshes will be used to build the model
and nothing else, and it must be in sequential order. This is not enough, however.
Now, you must establish the order of relationship between the parent and the children.
This is what is known as the heirarchy. This is properly done with the LINK LIMB command
and NOT GLUE OBJECT TO LIMB.

Gluing an object to a limb is not the way to properly set up an object's hierarchy.
That command is intended to allow and object (a person for example) to pick up another
object (a gun or something). This temporarily includes the object that was glued to a specific
limb of another object's hierarchy with the intension of later removal (UNGLUE OBJECT).
Where as using REMOVE LIMB would be destructive for this purpose.

3. Limb Offsets and Pivots

At this point you can provided the limb offsets, but I believe it can be done before
linking the limbs as well.

Objects that are created with DarkBasic with primatives rotate about ther center.
If and object was built with a modelling program, you can define it's origin
or pivot point. My point is there are limitations to what can be done with this
kind of model construction with DarkBasic.


I hope this helps.
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 4th Jan 2007 01:29
I have zmodeler and the trial 30 day version or milkshape but the trial doesn't come with help. I know milkshape can animate but I don't have a clue how to make my own models. I used zmodeler to make meshes but I can't animate because there's no option to. With zmodeler I know I can set the objects pivot by having the pivot in at 0,0,0. I need to know how to use the primitives in darkbasic first.

I don't know any way to link a parent limb to a limb to another limb, which is parent,parent,child,which is tahe arms or legs.

Animation is another problem, I don't know how to animate using darkbasic commands.

I will try to use link limb instead of glue object to limb, yet I don't think that will help me with limbpivots-p.s. I read nearly all the forums on limbpivots. The glue seemed most reasonable.

AutoCam Off

make object cylinder 1,10
position object 1,0,0,0
for m=2 to 9
make object cylinder m,5
make mesh from object m,m
next m
Make Object sphere 10,10
make mesh from object 10,10
for x=1 to 10
set object cull x,0
next x

add limb 1,1,10
add limb 1,2,2
add limb 1,3,3
add limb 1,4,4
add limb 1,5,5

link limb 1,1,1
link limb 1,1,2
link limb 1,1,3
link limb 1,1,4
link limb 1,1,5



Offset Limb 1,1,0,7.5,0
Offset Limb 1,2,-5,4,0
Offset Limb 1,3,5,4,0
Offset Limb 1,4,-5,-4,0
Offset Limb 1,5,5,-4,0



position camera 0,30,-30
point camera object position x(10),object position y(10),object position z(10)
wait key

illegal?
why?
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 4th Jan 2007 22:43 Edited at: 4th Jan 2007 23:03
The parent instance can be a little tricky...

In the LINK LIMB command parameters, you have to think of the last TWO numbers
as the object's limbs (instance) and not the object in itself. Hence the word, limb.

LINK LIMB Object Number, Parent Limb, Child Limb


So in this case, we are adding 5 limbs to object 1. The Parent is technically
not a limb, but the object itself. We need to call it something in order
to satisfy the parameters of the LINK LIMB Command. There is no limb here, so
we call it zero. This is usually termed as the ROOT.

As Stated in the newly revised source code below, calling the Object zero
will not always apply to exported object that are loaded into DarkBasic.
This depends on the modelling program and the exporters it employs.

The reason is that there may be a World Instance added to the beginning of
the objects hierarchy. This is the case even if the Object has no childern.
(You could think of the object here as being the child of the 3D world.)
The object would be then refered to as ROOT=Limb 1.

Because we are defining the objects hierarchy within DarkBasic code, we are not
adding any other instances to the object. Instances can be just a reference,
label, mesh, or a set of special parameters specific to a certain modelling
package that describes what to do with the model once loaded into it's 3D
environment.

The child of the parent would be in this case, the head, arms, and legs.

Think of how Windows uses files and folders and it may give you a better
idea of what I'm talking about.

Your source code with my revisions:


Once you study and understand the code above, I will give you some ideas
on animating an object set up this way.
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 6th Jan 2007 00:00
I was trying to make a guy that could be smahed and hit making his body parts unglue but I have doubts that the animation will work with glued objects.

Anyway this figure which doesn't work for some magical reason was as close to your example that I could get while keeping my original idea.

For your animation lessons I'll use your above code snip to follow, btw the arms and legs don't rotate around where it touches the big cylinder(chest) which was another thing I was trying to accomplish.

I read through your example which make sense and believe I understand. I found out how to make figures, bones, and animations using milkshape. The only problem is that I have 21 more days to keep it.lol
I appreciate your help D Ogre.

code snippet

AutoCam Off
sync on

make object cylinder 1,10
position object 1,0,0,0
for m=2 to 9
make object cylinder m,5
next m
Make Object sphere 10,10
for g=11 to 19
Make Object sphere g,1
next g
make mesh from object 11,11

add limb 1,1,11
add limb 1,2,11
add limb 1,3,11
add limb 1,4,11
add limb 1,5,11
add limb 2,1,11
add limb 3,1,11
add limb 6,1,11
add limb 7,1,11

delete mesh 11

link limb 1,0,1
link limb 1,0,2
link limb 1,0,3
link limb 1,0,4
link limb 1,0,5
link limb 2,0,1
link limb 3,0,1
link limb 6,0,1
link limb 7,0,1

Offset Limb 1,1,0,10,0
Offset Limb 1,2,-5,8,0
Offset Limb 1,3,5,8,0
Offset Limb 1,4,-5,-8,0
Offset Limb 1,5,5,-8,0
Offset Limb 2,1,0,-3,-1
Offset Limb 3,1,0,-3,-1
Offset Limb 6,1,0,-3,-1
Offset Limb 7,1,0,-3,-1

glue object to limb 10,1,1
glue object to limb 2,2,1
glue object to limb 3,3,1
glue object to limb 6,4,1
glue object to limb 7,5,1
glue object to limb 4,1,2
glue object to limb 5,1,3
glue object to limb 8,1,6
glue object to limb 9,1,7


position camera 0,-10,-50
point camera object position x(1),object position y(1),object position z(1)
do
roll object left 5,2
sync
loop
wait key
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 6th Jan 2007 01:37 Edited at: 6th Jan 2007 02:15
I know exactly what your wanting to do with your guy. It is possible to
due this, but not without doing some work outside of DarkBasic. As I said
before DB generates object primitives with the object pivots centered
with no provisions with hard coding to change this.

By todays standards, segmented limb based character modelling is essentially
obsolete because of skin and bone based modelling. However this does not say
that the old way is exactly gone and forgotten. Under some circumstances it may
prove to be a necessary approach.

If your planning on doing any projects with 3D, I would recommend investing some
time and money in a modeller such as Milkshape. If money is an issue, you could
try Blender. Blender is fully free to use and distribute within any educational,
professional or commercial environment. Artwork created with Blender including
python scripts is the sole property of the creator as the web site states. It

supports many file formats either in 2D or 3D. You have to make the decision.

As far as separating limbs from the main object, you could approach this in
several ways. The method would be determined by the desired effect.

Methods and possible repercussions:

1. Remove Limb - This would effective destroy the limb and any sub-children in
the object hierarchy. Not really recommended as it is a permanent solution which
means the model would have to be reloaded or rebuilt with code in DarkBasic.

2. Hide Limb - This will render it invisable and it will leave the model intact.

3. Switching Limbs With Other Limbs - Hiding a limb, then repositioning it in
the same location as the limb that needs to be switched. Show the new limb and
hide the original. This doesn't exactly meet the critia of "blowing it off",
but I deemed it worth mentioning.

4. Switch Entire Model With A New One - Similar to above, but with the whole object.
This could be done with skin and bone models as well.

5. Scattering Limbs - This is easy with segmented models. Just reposition the
limbs away from the object. You could hard code this. Keep in mind that no matter
where the main object is in the scene, the limbs are still attached and they will
still move if the object moves after this point.

The above info is just some additional thoughts that may give you some ideas for your
future projects.

I will keep you posted about the animation later. Give me some time to work out
a decent demo...
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 9th Jan 2007 23:40
Just a little update.

I am still working on the animation demo.

I have some issues to work out with the object hierarchy when adding and linking
the limbs. I'm assuming that your working with DBPro. I coding the demo as
such at the moment. However, I may have assumed incorrectly. I may have to use
IanM's Utility plugin to set things up properly. This shouldn't cause a problem
here. I will try to keep the finished project using standard DBPro commands in the
end.
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 12th Jan 2007 03:13 Edited at: 12th Jan 2007 03:14
Well, I have two small and simple demos for you. (That is if your still interested.)
I had planned on doing a larger demo, but I'm still working out a way to do it in
DBPro. My post the bigger project later...

Demo #1:

It demostrates a possible way of positioning and rotating a limb around the
main object. It gives the appearance of the limb pivoting somewhere other than its
center axis. This can also be done with two seperate objects as well.



Demo #2:

This demo shows how you could rotate a set of limbs that could make up an arm or
leg of a model.

legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 14th Jan 2007 04:32
Sorry it took me a while to reply, I've been experimenting with my new favorite program, Milkshape. Everything is easy now except having 5 hours of homework everyday.

Anyway your demos gave me some great insight for animation with a low frames per second. Instead of animating my other objects in milkshape I can easily use the elbow demo's example.

I'll have my new code in a few hours.
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 15th Jan 2007 05:48
more pain and suffering.

AutoCam Off
sync on
for z=17 to 21
make object cylinder z,10
position object z,0,0,0
next z
make object cylinder 2,5
scale object 2,.5,0,.5
for m=3 to 10
make object cylinder m,5
scale object m,0,5,0
next m
Make Object sphere 11,10
for g=12 to 16
Make Object sphere g,1
next g
for p=2 to 21
set object cull p,0
next p
make mesh from object 1,2
make mesh from object 2,3
make mesh from object 3,12
make mesh from object 4,11

for x=2 to 16
delete object x
next x

add limb 17,1,1
add limb 17,2,3
add limb 17,3,4
add limb 18,1,2
add limb 18,2,3
add limb 18,3,2
add limb 19,1,2
add limb 19,2,3
add limb 19,3,2
add limb 20,1,2
add limb 20,2,3
add limb 20,3,2
add limb 21,1,2
add limb 21,2,3
add limb 21,3,2

delete mesh 1
delete mesh 2
delete mesh 3
delete mesh 4

link limb 17,0,1
link limb 17,1,2
link limb 17,2,3
link limb 18,0,1
link limb 18,1,2
link limb 18,2,3
link limb 19,0,1
link limb 19,1,2
link limb 19,2,3
link limb 20,0,1
link limb 20,1,2
link limb 20,2,3
link limb 21,0,1
link limb 21,1,2
link limb 21,2,3

Offset Limb 17,1,0,5,0
Offset Limb 17,2,0,5,0
Offset Limb 17,3,0,5,0
Offset Limb 18,1,0,2.5,0
Offset Limb 18,2,0,2.5,0
Offset Limb 18,3,0,2.5,0
Offset Limb 19,1,0,2.5,0
Offset Limb 19,2,0,2.5,0
Offset Limb 19,3,0,2.5,0
Offset Limb 20,1,0,2.5,0
Offset Limb 20,2,0,2.5,0
Offset Limb 20,3,0,2.5,0
Offset Limb 21,1,0,2.5,0
Offset Limb 21,2,0,2.5,0
Offset Limb 21,3,0,2.5,0

position camera 0,10,-30
point camera object position x(17),object position y(17),object position z(17)
do
turn object left 17,2
sync
loop

wait key
legorain
17
Years of Service
User Offline
Joined: 31st Dec 2006
Location: US of A, californ-eye-a
Posted: 15th Jan 2007 05:50
whoops the last one was wrong(lol)

AutoCam Off
sync on
for z=17 to 21
make object cylinder z,10
position object z,0,0,0
next z
make object cylinder 2,5
scale object 2,0,0,0
for m=3 to 10
make object cylinder m,5
scale object m,0,5,0
next m
Make Object sphere 11,10
for g=12 to 16
Make Object sphere g,1
next g
LimbXsize#=object size x(17)
limbYsize#=object size y(17)
LimbXsizee#=object size x(18)
limbYsizee#=object size y(18)
LimbXsizeee#=object size x(19)
limbYsizeee#=object size y(19)
LimbXsizeeee#=object size x(20)
limbYsizeeee#=object size y(20)
LimbXsizeeeee#=object size x(21)
limbYsizeeeee#=object size y(21)

for p=2 to 21
set object cull p,0
next p
make mesh from object 1,2
make mesh from object 2,3
make mesh from object 3,12
make mesh from object 4,11

for x=2 to 16
delete object x
next x

add limb 17,1,1
add limb 17,2,3
add limb 17,3,4
add limb 18,1,2
add limb 18,2,3
add limb 18,3,2
add limb 19,1,2
add limb 19,2,3
add limb 19,3,2
add limb 20,1,2
add limb 20,2,3
add limb 20,3,2
add limb 21,1,2
add limb 21,2,3
add limb 21,3,2

delete mesh 1
delete mesh 2
delete mesh 3
delete mesh 4

link limb 17,0,1
link limb 17,1,2
link limb 17,2,3
link limb 18,0,1
link limb 18,1,2
link limb 18,2,3
link limb 19,0,1
link limb 19,1,2
link limb 19,2,3
link limb 20,0,1
link limb 20,1,2
link limb 20,2,3
link limb 21,0,1
link limb 21,1,2
link limb 21,2,3

limbXoffset#=(object size x(17)+limbYsize#)/2
limbYoffset#=(object size y(17)+limbYsize#)/2
limbXoffsett#=(object size x(18)+limbYsizee#)/2
limbYoffsett#=(object size y(18)+limbYsizee#)/2
limbXoffsettt#=(object size x(19)+limbYsizeee#)/2
limbYoffsettt#=(object size y(19)+limbYsizeee#)/2
limbXoffsetttt#=(object size x(20)+limbYsizeeee#)/2
limbYoffsetttt#=(object size y(20)+limbYsizeeee#)/2
limbXoffsettttt#=(object size x(21)+limbYsizeeeee#)/2
limbYoffsettttt#=(object size y(21)+limbYsizeeeee#)/2

position camera 0,30,-30
point camera object position x(17),object position y(17),object position z(17)
do
angle#=wrapvalue(angle#+1.0)
limbXpos#=sin(angle#)*limbXoffset#
limbypos#=cos(angle#)*limbYoffset#
limbXposs#=sin(angle#)*limbXoffsett#
limbyposs#=cos(angle#)*limbYoffsett#
limbXposss#=sin(angle#)*limbXoffsettt#
limbyposss#=cos(angle#)*limbYoffsettt#
limbXpossss#=sin(angle#)*limbXoffsetttt#
limbypossss#=cos(angle#)*limbYoffsetttt#
limbXposssss#=sin(angle#)*limbXoffsettttt#
limbyposssss#=cos(angle#)*limbYoffsettttt#

Offset Limb 17,1,limbXpos#,limbypos#,0
Offset Limb 17,2,limbXpos#,limbypos#,0
Offset Limb 17,3,limbXpos#,limbypos#,0
Offset Limb 18,1,limbXpos#,limbypos#,0
Offset Limb 18,2,limbXposs#,limbyposs#,0
Offset Limb 18,3,limbXpos#,limbypos#,0
Offset Limb 19,1,limbXpos#,limbypos#,0
Offset Limb 19,2,limbXposss#,limbyposss#,0
Offset Limb 19,3,limbXpos#,limbypos#,0
Offset Limb 20,1,limbXpos#,limbypos#,0
Offset Limb 20,2,limbXpossss#,limbypossss#,0
Offset Limb 20,3,limbXpos#,limbypos#,0
Offset Limb 21,1,limbXpos#,limbypos#,0
Offset Limb 21,2,limbXposssss#,limbyposssss#,0
Offset Limb 21,3,limbXpos#,limbypos#,0
sync
loop

wait key
D Ogre
20
Years of Service
User Offline
Joined: 19th Nov 2003
Location:
Posted: 16th Jan 2007 00:03 Edited at: 16th Jan 2007 00:11
I can't read minds. What exactly are you trying to do with the code above?
All I get is a couple of limbs rotating around what appears to be your object
or objects. All I can do is help you optimize your code at this point.

You can use arrays to setup multiple objects. With DBPro, you can also use
UDTs (User Defined Types). When you want to act upon a limb or object, just
recall the information from the array(s).



This way you can use the same block of code for many objects by just
changing the array index within a loop. Experiment! You'll get it...

Another thing, try using
next time you post
a code snippet.

Login to post a reply

Server time is: 2024-05-19 11:12:43
Your offset time is: 2024-05-19 11:12:43