To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10323
10322  |  10324
Special: 
[DAT] (requires LDraw-compatible viewer)
Subject: 
Re: Thoughts on File Format for LDraw Animation
Newsgroups: 
lugnet.cad.dev
Date: 
Sat, 29 Oct 2005 08:13:27 GMT
Viewed: 
3278 times
  
I think James was saying that the subfiles in an MPD can be treated as the
'name'.  This is true, as long as you also require that each subfile only be
used once.

So a file like:

0 FILE test1.mpd
1 15 0 -24 0 1 0 0 0 1 0 0 0 1 block1
1 4 0 0 0 1 0 0 0 1 0 0 0 1 block2
0 FILE block1
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0 FILE block2
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0

Would have 2 named objects, block1 and block2.

Yes, this is exactly what I suggest in my tutorial on how to model stuff.  Then,
in test1.mpd, you can rotate block1, and it will rotate all of its children as
well!  And you *should* rotate block1 so that you can see if you got its
rotation axis right.  You will see it immediately if it is wrong.  The rest of
my tutorial says how to fix it.  Again the link is:

http://james.magnusviri.com/lego/animatable_models/

You could use some naming convention to make it so that a tool knows what it
should list as a child, like this:

0 FILE test1.mpd
1 15 0 -24 0 1 0 0 0 1 0 0 0 1 ani_block1
1 4 0 0 0 1 0 0 0 1 0 0 0 1 ani_block2
0 FILE ani_block1
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0 FILE ani_block2
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0

Anything that starts with "ani_" is a child or parent etc.  A parsing tool could
then look for duplicate names and append a unique number if there are dups, like
this:

0 FILE test1.mpd
1 15 0 -24 0 1 0 0 0 1 0 0 0 1 ani_block1
1 4 0 0 0 1 0 0 0 1 0 0 0 1 ani_block2
1 -4 0 0 0 1 0 0 0 1 0 0 0 1 ani_block2
0 FILE ani_block1
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0 FILE ani_block2
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0

The tool would see ani_block2 is there twice, it could then decide to ask the
user what to do or just change it to ani_block2_a and ani_block2_b.

If you wanted to add rotation constraints, make it a comment in the file.

0 FILE test1.mpd
1 15 0 -24 0 1 0 0 0 1 0 0 0 1 ani_block1
1 4 0 0 0 1 0 0 0 1 0 0 0 1 ani_block2
1 -4 0 0 0 1 0 0 0 1 0 0 0 1 ani_block2
0 FILE ani_block1
0 COMMENT rotation constraints: x > 5, x < 100
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0 FILE ani_block2
1 16 0 0 0 1 0 0 0 1 0 0 0 1 3010.dat
0

or whatever.  My point is that the ldraw format should focus on models.  Leave
the placement and such to another file format.

Already using this format will lead to correctly built models.  I haven't
checked l3p, but I know Anton's POV-Ray converter will correctly nest the
models.  So I can convert an mpd, and with a tiny bit of modifications (very
tiny) I can set up a macro for a mech that I can tell it where to place the legs
and arms and everything.  (Read below where I talk about minifigs to see what I
mean) Ok, so I haven't really done much to show this.  But someday I will... :D
I have a few other projects I need to finish first.

But it might not be practical -- it would be a pain to have to
create a new set of minifig subfiles for each character in a crowd scene.

Minifigs should be treated differently.  They are so simple, yet so complex.
The base minifig is 10 bricks, and they are all mostly in the same location.
I've worked out the different combinations in my POV-Ray macro (the one that
isn't posted to the web yet).  So I can specify any color easily.  I can swap a
normal leg with a leg with a decal or with a pirate's leg.  I can swap out a
normal hand with a hook hand.  I can specify the head gear.  I can add items to
the hands and feet.  I can put on neck gear (air tank) and the head goes up the
correct amount (not all neck gear is the same size).  I can put items in it's
hand, a shovel, a revolver, lightsaber, and even custom weaponry.  It also
includes the code to walk.

My POV-Ray minifig macro is... huge.

The equivelent for non-pov-ray stuff is a program or to have your animation
script have minifig smarts built in.  It is just the easiest way to go.  That
is, it would be easier to write a program/script to do all of this than to use
mpd minifig files.  You could use dummy files, but remove them from the models
when you are ready to animate them.

You can see my old version of my minifig macro here:

http://james.magnusviri.com/lego/minifig/

I have a minifig macro/function/subroutine.  I create a minifig using something
like this (this one is just a simple reduction, but it gives you the idea):


minifig(head_wear, face_pattern, head_color, neck_gear, torso_pattern,
torso_color, right_arm_color, right_hand_color, right_hand_gear, left_arm_color,
left_hand_color, left_hand_gear, hip_color, hip_pattern, right_leg_color,
right_leg_pattern, right_leg_wear, left_leg_color, left_leg_pattern,
left_leg_wear)

I say it is a simple reduction because I left off the types for skeleton
arm/leg/torso/hip, hook, peg leg, etc.  And I left off the variables for setting
helmet color, visor angle, position of stuff that is in the hand, rotations of
the limbs, etc, etc.

Anyway, my point with minifigs is that it is easier to write something to do all
of this for you.  Every minifig is similar enough it is worth it rather than
creating 100 minifig mpd's.  The minifig macro I have has about 100 predefined
unique minifigs, with many hand items and head wear, etc.  The predefined
minifigs are created by just calling a macro for that minifig:

minifig14(head_rotation, right_arm_rotation, left_arm_rotation,
right_leg_rotation, left_leg_rotation, visor_rotation)

Then, this becomes very easy to animate in a povray script:

minifig14(clock+k, 0, clock*2, clock/2, clock/2*-1, 0)

This is how I handle the walking...  (again, simplified explaination, but the
ideas are the same)

James



Message has 1 Reply:
  Re: Thoughts on File Format for LDraw Animation
 
(...) This menas a huge download every time you wish to updated? <snip> Your project is in deed very interesting. I will try to follow the progress, and someday maybe I'll join it! But for now, I will explore where the LDA project leads. (...) Well, (...) (19 years ago, 30-Oct-05, to lugnet.cad.dev)

Message is in Reply To:
  Re: Thoughts on File Format for LDraw Animation  [DAT]
 
(...) Well, hair goes under the category "Hat". It may sound a little strange, but that's the way it has to be. Like I said: 0 FILE Head 0 Name: Head 0 [This Object] 1 16 0 0 0 1 0 0 0 1 0 0 0 1 3626bp01.dat 0 [Child Objects] 1 0 0 0 0 1 0 0 0 1 0 0 (...) (19 years ago, 27-Oct-05, to lugnet.cad.dev)

30 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR