User Tools

Site Tools


ofp:file_formats:4wvr

Differences

This shows you the differences between two versions of the page.


ofp:file_formats:4wvr [2007/07/04 14:17] – created 4wvr initial page snakeman
Line 1: Line 1:
-====== WRP - 4WVR ====== 
  
-Flashpoint wrp files use two different file formats to contain the data. This document contains information on 4WVR format as used by WrpTool and Visitor 2.  
- 
-This document does not discuss the alternate format, OPRW. Both file formats can be used directly by the engine, whether the file exists independently in ~\worlds, or, packed inside a pbo (addon).  
- 
-See General Wrp format for further info.  
- 
-"Binarize" tool by BIStudio will convert 4WVR to OPRW if desired.  
- 
-(some problems exist with 2 versions of binarize) 
- 
-**Conventions** 
- 
-<code> 
-Intel byte order, lsb first 
-byte = 1 char = 8 bits 
-ulong = unsigned long, 4 bytes 
-ushort= unsigned short 2 bytes 
-asciiz= variable length zero terminated string. 
-float= 4byte (single precision) 
-</code> 
- 
-====== Structure ====== 
- 
-<code> 
-struct  
-{ 
- byte Signature[4]; //"4WVR" 
- ulong Xsize;       //(=256) cell dimension 
- ulong Ysize;       //(=256) cell dimension 
- short Elevations[Ysize][Xsize]; // eg 2*256*256 = 131072 bytes See Note 
- short TextureIndex[Ysize][Xsize]; // eg 2*256*256 = 131072 bytes 
-     //Each 'index' refers to a filename below. Max value = 511 
- Asciiz TextureFilenames[512][32]; 
-/* 
-A max of 512 texture files can be listed. Each is held as an asciiz string inside a fixed 32 byte 
-record. Eg max length of filename is 31 characters. 
-  example: data\pi.paa 
-*/ 
- 
-struct model 
-{ 
- float  TransformMatrix[12]; //see below 
- long   3DobjectIndex;       //the unique ouid for this model 
- asciiz Filename[76]; 
-  //each string is held within a 76 byte record. Therefore filename is 75 chars max. 
-}[variable]; 
-}; 
-</code> 
- 
-====== Note1 ====== 
- 
-TransformMatrix[4][3];  
- 
-This is the transform matrix used directly by Microsoft DirectX engines.  
- 
-In fact, the 'correct' matrix is actually 4 x 4, but the last column always represents 0,0,0,1 thus 
- 
-<code> 
-M11,M12 M13 (0.0) 
-M21,M22,M23 (0.0) 
-M31,M32,M33 (0.0) 
-M41,M42,M43 (1.0) 
-</code> 
- 
-and so is never stored. This identical matrix is used for WRP files (both formats) and RTM files. The last row (M41...) happens to be the position of the object X Z Y co-ordinates, and is often referred to separately.  
- 
-For further information visit [[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/fixedfunction/transforms/transforms.asp|here]]. 
- 
-====== Note2 ====== 
- 
-The number of models varies from none, to end of file. Each model is 128 bytes in length. 
ofp/file_formats/4wvr.txt · Last modified: 2024/07/31 12:36 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.