Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ogl2dlib-sdl locus data text format demo

4 views
Skip to first unread message

kaikai

unread,
Dec 21, 2005, 11:02:13 AM12/21/05
to luminesskin
I've implemented a locus animation text data file formatted as follows.
A file will contain image references, usable rectangle parts from those
images and animation elements' locus data. Each element is defined with
a set of locus including a picture locus (determine which picture
should be displayed at a certain frame), a position locus (the moving
path), a zooming locus, a rotation locus, a color locus and an alpha
locus. All except the picture locus could be omitted. Locus is a
template, it can handle 3 types of interpolation, linear, b-spline and
no interpolation (change between control data point will be step).
It works just fine.
But I think locus data could be picked out and be organized together
thus different elements of an animation could use the same locus data
just by giving the same locus index number ! This will be good to
reduce overlapped data especially in particle-like animations.

Here goes the example, 2 images referenced in the animation. From these
images, 3 rectangle is picked out. Element 0 will display at the center
of the animation flipping the 3 pictures (clipped by 3 rentangle from
the 2 images). Element 1 will moving through a square border line. The
whole animation least 40 frames.

# file test.txt

# HINTS
# * lines begin with a '#' will be ignored by locus text loader
# * sections MUST follow their order.

##################################
#SECTION 1, pictures goes here
##################################
# an integer 'n', represents the amount of pictures
2

# 'n' path to those pictures, one path per line. path may
# be relative to the PROGRAM
image/bugmask.jpg
image/cat.jpg

##################################
#SECTION 2, faces goes here
##################################
# an integer 'f', represents the amount of valid rects
3

# 'f' rects, formatted as:
# pic left top right bottom
# @pragma pic the picture id within [0..n-1]
0 0 0 100 100
0 100 0 200 100
1 10 10 20 30

##################################
#SECTION 3, elements
##################################
# an integer 'e', represents the amount of elements
# an integer 'len', represents the length of animation in frames
2 40

# e elementes...
# every element has its own locus data
#################
# element 0
#################
# SECTION 3.1, face locus
# a string may contain some or all charactors from
# 'F' must exist face locus
# 'P' optinal position locus
# 'Z' optinal zoom locus
# 'R' optinal rotation locus
# 'C' optinal color locus
# 'A' optinal alpha locus
# e.g.
# FPC means the following locus sequence as face+position+color
F

# an integer 'l', represents the amount of face locus data
# followed with an integer type [0,1,2] means LT_LINEAR = 0,
LT_B_SPLINE = 1, LT_STEP = 2
# face locus's type must be 2(LT_STEP)
3 2

# l lines of data, each line will formatted as:
# time faceid
# @pragma time [0..x] frame time
# @pragma faceid [0..f-1]
0 0
10 1
20 2

#################
# element 1
#################
FP

# face, step
2 2

0 0
40 0

# pos, linear
5 0

0 -10 -10
10 -10 10
20 10 10
30 10 -10
40 -10 -10
#/////////////////////// end of the file//////////////

kaikai

Reply all
Reply to author
Forward
0 new messages