Introduction :
Texture animation is the only way to make
a world file animated (Re-Volt) using .w file
Currently, only two teams have succeeded
in making multiframes which are RRR and RVTT (now RVL
as well)
Demo:
You can download it from here (it’s
Re-Volt Level)
Textures
by Urnemanden. (thanks a lot :) )
Getting multiframe working (my way):
1.
Setting the required type:
Known flags:
[Quad flag] = 1
[Double-Side Flag]=2
[Translucent Flag]=4
[TexAnim Flag] = 512
[ENV on Flag] = 1024
For type of mesh, the “Texture Animated
mesh” must have [TexAnim Flag].
Examples:
·
Triangular mesh with TexAnim on: [TexAnim Flag]
o
512
·
Quad Mesh,with Tex Anim
on: [Quad Flag] + [TexAnim Flag] = 1 + 512 = 513
o
513
·
Quad Mesh, double sided and Texture Animation on: [Quad Flag] +
[Double-side flag] + [TexAnim Flag] = 1+2+512 = 515
o
515
Note: ASE2W converts Quad meshes to Triangular ones
2.
From Tri to Quad (Tutorial):
It’s highly recommended that your convert
“triangular meshes” into “quads meshes” (a GUI will be created for that)
In the demo package, there is export .w (or just create your own .w
file)
The
first mesh (aka cube) is the multiframed one, the
other is the blank plane
After
decoding a file named “multiframe.w.txt” will be created
#############################################
# multiframe.w
#############################################
#cubes count
rvlong 2
#cube:1
#Bounding sphere (X,Y,Z, radius)
rvfloat 358.7139
rvfloat 958.716
rvfloat -658.2766
rvfloat 561.7676
#Bounding Box (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax)
rvfloat -177.2125
rvfloat 894.6403
rvfloat 789.4481
rvfloat 1127.984
rvfloat -659.2766
rvfloat -657.2766
#Poly count
rvshort 2
#Vertex count
rvshort 4
#Poly n?1
Well notice the poly count:
#Poly count
rvshort 2
That’s because ASE2W split the quad based
meshes into triangles (or actually it’s ASE exporter
which does that)
So, we will make convert it to a quad by hand, this by
#Poly count
rvshort 1
Faces were like this:
#Faces (vertex index
which link to a face)
rvshort 2
rvshort 1
rvshort 0
rvshort 0
Note: the fourth index won’t be
taken (will be ignored in Triangular meshes)
We will change them to:
#Faces (vertex index
which link to a face)
rvshort 0
rvshort 2
rvshort 3
rvshort 1
Now this will affect a lot of stuffs
First, we need to delete the 2nd
poly (this:
#Poly n?2
#type
rvshort 0
#texture
rvshort 0
#Faces (vertex index which link to a face)
rvshort 1
rvshort 2
rvshort 3
rvshort 0
#Vertex Color [3 or 4 depends on the type]
(including alpha channel)
rvulong 16777215
rvulong 16777215
rvulong 16777215
rvulong 16777215
#UV map
#(1) UV
rvfloat 0
rvfloat 0.1561
#(2) UV
rvfloat 0.8141
rvfloat 0
#(3) UV
rvfloat 0
rvfloat 0
#(4) UV
rvfloat 0
rvfloat 0
Ok, then we have
got this UV mapping:
#(1) UV
rvfloat 0.8141
rvfloat 0
#(2) UV
rvfloat 0
rvfloat 0.1561
#(3) UV
rvfloat 0
rvfloat 0
#(4) UV
rvfloat 0
rvfloat 0
The first two Uv mapping shouldn’t be a problem
Now the 4th UV can be got from
here:
#(1) UV
rvfloat 0.8141
rvfloat 0
#(2) UV
rvfloat 0
rvfloat 0.1561
That means
#(4) UV
rvfloat 0.8141
rvfloat 0.1561
Now, remember that we have inserted “3”
inside 2 and 1
So…
#(3) UV
rvfloat 0
rvfloat 0
#(4) UV
rvfloat 0.8141
rvfloat 0.1561
That should become
#(3) UV
rvfloat 0.8141
rvfloat 0.1561
#(4) UV
rvfloat 0
rvfloat 0
The final UV map is going to look like
this:
#(1) UV
rvfloat 0.8141
rvfloat 0
#(2) UV
rvfloat 0
rvfloat 0.1561
#(3) UV
rvfloat 0.8141
rvfloat 0.1561
#(4) UV
rvfloat 0
rvfloat 0
3.
513 for Quad, 512 for Tri:
#Poly n?1
#type
rvshort 1
will become
#Poly n?1
#type
rvshort 513
4.
Texture Animation/Multi Frames:
#
-----------------------------------
#multiframe
count
rvlong 0
can be found at last lines.
The multiframes
are more like this:
·
rvlong [Animation count]
o
rvlong [FrameCount]
o
rvlong [Texture Page]
o
rvfloat [time in seconds]
o
rvfloat [U1]
o
rvfloat [V1]
o
rvfloat [U2]
o
rvfloat [V2]
o
rvfloat [U3]
o
rvfloat [V3]
o
rvfloat [U4]
o
rvfloat [V4]
See Toy2.w and multiframe.w
demos to understand them very well
Note: For getting UV map, I have used 3Ds max (you can use the tool I’m creating,
much easier I guess ;) )