ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Difference between revisions of "HVA"

From ModEnc
Jump to: navigation, search
(Created page with "HVA files ('''H'''ierarchical '''V'''oxel '''A'''nimation, file extension {{tt|.hva}}) contain additional information regarding a voxel model: section position, section ro...")
 
(Added a section about the transformation matrix.)
 
Line 1: Line 1:
 
HVA files ('''H'''ierarchical '''V'''oxel '''A'''nimation, file extension {{tt|.hva}}) contain additional information regarding a [[voxel]] model: section position, section rotation, and frame count. As its name suggests, HVA allows the voxel model to be animated when multiple frames are defined. In-game, a voxel unit is animated when moving, or in case of jumpjet units in RA2/YR, both when moving and hovering.
 
HVA files ('''H'''ierarchical '''V'''oxel '''A'''nimation, file extension {{tt|.hva}}) contain additional information regarding a [[voxel]] model: section position, section rotation, and frame count. As its name suggests, HVA allows the voxel model to be animated when multiple frames are defined. In-game, a voxel unit is animated when moving, or in case of jumpjet units in RA2/YR, both when moving and hovering.
  
Each HVA frame has its own position and rotation offsets for every section in the voxel model. By manipulating these offsets, you can produce a smooth animation across the frames.
+
Each HVA frame has its own position and rotation offsets for every section in the voxel model. By manipulating these offsets, you can produce a smooth animation across the frames. See the [[#Transformation Matrix|Transformation Matrix]] section below for more information.
  
 
Examples of animated models include the Mammoth Mk. II in TS and the Siege Chopper in YR.
 
Examples of animated models include the Mammoth Mk. II in TS and the Siege Chopper in YR.
  
 
Note that HVA files are essential; when the game loads a voxel file (e.g. {{tt|tank.vxl}}), if it doesn't find the accompanying HVA file ({{tt|tank.hva}}), the game will crash.
 
Note that HVA files are essential; when the game loads a voxel file (e.g. {{tt|tank.vxl}}), if it doesn't find the accompanying HVA file ({{tt|tank.hva}}), the game will crash.
 +
 +
== Transformation Matrix ==
 +
 +
The HVA file contains a standard [https://en.wikipedia.org/wiki/Transformation_matrix transformation matrix], which allows manipulating the voxel model in 3D space: rotating, shearing, positioning, or scaling. Each HVA frame contain a separate matrix and for each voxel section, allowing each section to be manipulated independently for each frame to produce an animation.
 +
 +
The matrix appears as follows:
 +
 +
{| class="wikitable"
 +
|Width
 +
|Y to X Shear
 +
|Y to Z Shear
 +
|X Offset
 +
|-
 +
|X to Y Shear
 +
|Height
 +
|Z to Y Shear
 +
|Y Offset
 +
|-
 +
|X to Z Shear
 +
|Y to Z Shear
 +
|Length
 +
|Z Offset
 +
|}
 +
 +
X is left/right, Y is up/down, Z is forward/backward. The offset values are in [[Voxel|voxels]]. Width, height, and length are multipliers.
 +
 +
Shearing essentially rotates one axis towards another. For example, positive values on the "Y to X Shear" variable rotate all points (voxels) along the Y axis towards the X axis (points up from the origin are rotated left, points down are rotated right).
  
 
== See Also ==
 
== See Also ==

Latest revision as of 20:51, 31 May 2024

HVA files (Hierarchical Voxel Animation, file extension .hva) contain additional information regarding a voxel model: section position, section rotation, and frame count. As its name suggests, HVA allows the voxel model to be animated when multiple frames are defined. In-game, a voxel unit is animated when moving, or in case of jumpjet units in RA2/YR, both when moving and hovering.

Each HVA frame has its own position and rotation offsets for every section in the voxel model. By manipulating these offsets, you can produce a smooth animation across the frames. See the Transformation Matrix section below for more information.

Examples of animated models include the Mammoth Mk. II in TS and the Siege Chopper in YR.

Note that HVA files are essential; when the game loads a voxel file (e.g. tank.vxl), if it doesn't find the accompanying HVA file (tank.hva), the game will crash.

Transformation Matrix

The HVA file contains a standard transformation matrix, which allows manipulating the voxel model in 3D space: rotating, shearing, positioning, or scaling. Each HVA frame contain a separate matrix and for each voxel section, allowing each section to be manipulated independently for each frame to produce an animation.

The matrix appears as follows:

Width Y to X Shear Y to Z Shear X Offset
X to Y Shear Height Z to Y Shear Y Offset
X to Z Shear Y to Z Shear Length Z Offset

X is left/right, Y is up/down, Z is forward/backward. The offset values are in voxels. Width, height, and length are multipliers.

Shearing essentially rotates one axis towards another. For example, positive values on the "Y to X Shear" variable rotate all points (voxels) along the Y axis towards the X axis (points up from the origin are rotated left, points down are rotated right).

See Also