|
Author Topic:   LUV FIle format?
KiLlEr
Member
posted June 28, 2003 03:29 AM            
I'm writing a program to display LWO objects and I would like to add the UV information from an luv file. Can anyone supply me with the file format specs for this file type?

IP:

=DNX= Matrix
Member
posted June 28, 2003 12:49 PM            
Other than tutorials on Lithunwrap there seems to be very little on the LUV format.... perhaps Jim/LDA can be more help ?

IP:

KiLlEr
Member
posted June 29, 2003 12:05 PM            
Never mind, I figured it out

IP:

Dreamer
Member
posted July 06, 2003 05:00 PM         
Would you mind sharing your insights with us?

IP:

KiLlEr
Member
posted July 07, 2003 01:01 AM            
okay, you asked for it Its not too bad though.

NOTES:

1) File is in Big Endian format so you have to correct for Endianess on an Intel platform. Excerpts below are in Big Endian.
2) Dword -> Double word (2 bytes)


1st Dword = FORM
2nd Dword length of file in bytes (including the 1st and 2nd Dwords)
3rd Dword = UVMP
4th Dword = UVTX <- start of UV hunk
5th Dword length of UV hunk in bytes
6th DWord always 00 00 00 01
7th DWord is the number of polygons in hunk
for each polygon:
- 1st DWord, always: 00 00 00 00
- 2nd DWord, always: 00 00 00 00
- 3rd DWord, always: 00 00 00 03 ( I thought it was the number of verticies, but its not so)
- for each vertex in polygon:
-- 1st DWord = U coord in 32 bit float format
-- 2nd DWord = V coord in 32 bit float format

Each polygon in the lwo file corrosponds to one polygon in the luv file, in the same order they appear in the lwo file. Each UV pair corrosponds to the lwo file polygon's vertex index and appears in the same order.

Hope it made sense

[This message has been edited by KiLlEr (edited July 07, 2003).]

IP:

Dreamer
Member
posted July 08, 2003 03:42 AM         
So the # of vertices in a polygon is unknown unless you either read the whole polygon (up to the [8x 00] 00 00 00 03 separator or the corresponding .lwo file? Hm. Next step would be the lwo specs. Been hunting for those for quite a while now. (Never got around to asking someone like Lithium who is bound to know)

IP:

KiLlEr
Member
posted July 08, 2003 09:19 AM            
LOL!!

Why didn't you ask me? I've been reading and writing LWO files since Lightwave 1.0 on the Amiga. I even coded a DLL on the PC to load them (and just updated it to handle LUVs), as well as a new C# wrapper class that calls it.

And LWO file (like a LUV and ILBM files) are all Amiga files which use the IFF file format. However lightwave object files are a little funky, as they break a rule when defining a surface.

http://astronomy.swin.edu.au/~pbourke/geomformats/lightwave/


http://www.borg.com/~jglatt/tech/aboutiff.htm

Ask and Ye shall receive. Its the same text that appears in the Amiga Includes and Autodocs RKRM.

Also, I'm not 100% sure that the 00 00 00 03 is or is not the vertex count. Here's why:

1) You can't save an LUV with an object that is constructed out of polygons with more than 3 verticies in lithUnwrap. SO I can't test this case.

2) You can have <3 verticies in a polygon and save it in LithUnwarp, but the vertex count is still set to 00 00 00 03. This may as well be a bug in LithUnwrap itself.

Following standard IFF specs, that is suppose to be the number of verticies as that position within the hunk is used to specify the item count (as it did for the number of polygons).

[This message has been edited by KiLlEr (edited July 08, 2003).]

IP:

=DNX= Matrix
Member
posted July 08, 2003 09:51 AM            
IFF, sure you dont mean ILBM ? I not questioning you but i just dont see the connection.

IP:

=DNX= Matrix
Member
posted July 08, 2003 09:54 AM            
PS - AMIGA ROCKS !!! *specially if you had/have an opal board* - i still have my A1200 with lightwave and caligari (which evolved into pc-3d engine "TRUESPACE")- a bit slow by todays standards, but still a lot of fun to play with

IP:

KiLlEr
Member
posted July 08, 2003 11:54 AM            
Matrix, u sure you own an Amiga?

IFF -> Interchange File Format

ILBM -> Inter-Leaved Bit Map

An ILBM is stored in IFF on disk. An ILBM is an IFF, but an IFF is NOT an ILBM.

[This message has been edited by KiLlEr (edited July 08, 2003).]

IP:

CyberCannon
Member
posted July 08, 2003 04:14 PM            
Here I was thinking I understood the English language.

------------------
An Irish Blessing
May the road rise to meet you.
May the wind be always at your back.
May the sun shine warm upon your face.
The rains fall soft upon your fields and,
Until we meet again.
May God hold you in the palm of His hand.

CC

IP: