PDA

View Full Version : Reading Face Data


chrrox
12-26-2009, 02:04 PM
Reading Face Data
Can someone help me modify this code so the tri-strip ends when it reaches FF also would the best way to read the data is divide the total size by 6 or can you specify it will end after it has rad that many bytes.
00 00 00 01 00 02 FF FF 00 03 00 04 00 05 00 06 00 01 00 07 00 02 00 08 00 09 00 08 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 10 FF FF

FaceDirection = 1
f1 = ReadBEword f + 1 --read face indices, games are start form 0, but Max start from 1
f2 = ReadBEword f + 1 --so we add 1 to each index
for i = 3 to Fcount do ( --already readf 2 verts, so start from 3
f3 = ReadBEword f + 1
FaceDirection *= -1
if (f3 != f1) AND (f3 != f2) then ( --if not idential verts, create face
if FaceDirection > 0 then append Face_array [f1,f2,f3] --base on face direction to create face
else append Face_array [f1,f3,f2]
)
f1 = f2 --shift the verts
f2 = f3
)

if any more information is needed let me know thanks so much in advance :)

CGTalk Moderation
12-26-2009, 02:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.