Click here to Skip to main content
15,905,587 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: GRAPHICS CONTROL HELP Pin
Colin Angus Mackay18-Dec-04 19:27
Colin Angus Mackay18-Dec-04 19:27 
Generalhooking socket events with vb.net Pin
Asxetos18-Dec-04 15:04
Asxetos18-Dec-04 15:04 
GeneralRe: hooking socket events with vb.net Pin
Dave Kreskowiak19-Dec-04 10:15
mveDave Kreskowiak19-Dec-04 10:15 
GeneralRe: hooking socket events with vb.net Pin
Asxetos19-Dec-04 11:44
Asxetos19-Dec-04 11:44 
GeneralRe: hooking socket events with vb.net Pin
Dave Kreskowiak20-Dec-04 1:07
mveDave Kreskowiak20-Dec-04 1:07 
GeneralRe: hooking socket events with vb.net Pin
Asxetos20-Dec-04 4:00
Asxetos20-Dec-04 4:00 
GeneralCommon code for XP and PPC Pin
lemat18-Dec-04 5:33
lemat18-Dec-04 5:33 
GeneralReading from file Pin
High50018-Dec-04 4:06
High50018-Dec-04 4:06 
I have a binary file (3D object file .LWO format) and I am having terrible joy getting the information out that i require.

The file consisits of several Chunks which relate to different 3D data. But for the moment I am interested in only 1 section known as the PNTS chunk. The file format viewed in a hex editor is as follows:
<br />
464F524D 0000017E 4C574F32 54414753    FORM...~LWO2TAGS<br />
0000000E 446B426C 75004465 6661756C    ....DkBlu.Defaul<br />
74004C41 59520000 00120000 00000000    t.LAYR..........<br />
00000000 00000000 00000000 504E5453    ............PNTS<br />
00000060 C0000000 C0000000 C0000000    ...`À...À...À...<br />
40000000 C0000000 C0000000 40000000    @...À...À...@...<br />
C0000000 40000000 C0000000 C0000000    À...@...À...À...<br />
40000000 C0000000 40000000 C0000000    @...À...@...À...<br />
40000000 40000000 C0000000 40000000    @...@...À...@...<br />
40000000 40000000 C0000000 40000000    @...@...À...@...<br />
40000000 42424F58 00000018 C0000000    @...BBOX....À...<br />
C0000000 C0000000 40000000 40000000    À...À...@...@...<br />
40000000 504F4C53 00000040 46414345    @...POLS...@FACE<br />
00040000 00010002 00030004 00000004    ................<br />
00050001 00040001 00050006 00020004    ................<br />
00030002 00060007 00040000 00030007    ................<br />
00040004 00040007 00060005 50544147    ............PTAG<br />
0000001C 434F4C52 00000000 00010000    ....COLR........<br />
00020000 00030000 00040000 00050000    ................<br />
50544147 0000001C 53555246 00000001    PTAG....SURF....<br />
00010001 00020001 00030001 00040001    ................<br />
00050001 53555246 0000002A 44656661    ....SURF...*Defa<br />
756C7400 0000434F 4C52000E 3F48C8C9    ult...COLR..?HÈÉ<br />
3F48C8C9 3F48C8C9 00004449 46460006    ?HÈÉ?HÈÉ..DIFF..<br />
3F800000 0000                          ?€....               <br />


The data I require is the list of points in the PNTS chunk, The first 4 bytes that follow the PNTS header text are the length of the chunk (so I am lead to believe). Following that each co-ordinate is made of 12 bytes, 3 axis create a co-ordinate X,Y,Z which are 4 bytes each. In this particular 3D model i chose a real basic cube 4m each side. so there should be 8 points to build the object. 8*12 = 96 which should be the same as the length set by the 4 bytes following the PNTS header. Whichever way i try to read the file the most I am able to get is the first Y co-ordinate to the end, therefore im always missing the first X co-ord of the first point, I have tried moving my current file positions to get this value but to no avail. Instead of pasting here every way i have tried to read this file, is there anyone here who could suggest the best way in vb.net to get this information?

I need to seek the PNTS Header, get the length of the PNTS chunk using the next 4 bytes, then read in the VB SINGLE vlaues to hold each x,y,z co-ordinates. The points are stored in IEEE Floating Point 32bit Hexadecimal. I can read in the HEX no problem but again I am not qualified enough to do the mathmatical conversion required to convert to decimal.

The points should be as follows:
-2: -2 : -2
2 : -2 : -2
2 : -2 : 2
-2: -2 : 2
-2: 2 : -2
2 : 2 : -2
2 : 2 : 2
-2: 2 : 2

For some reason when i read from the start of this chunk i always get -3.5 for the first co-ord when using the binaryreader object in vb.net

I would appreciate any help or pointers anyone can give me

Thanks in advance

Stewart
GeneralCustom Control Tutorial Pin
inetmaster18-Dec-04 0:01
inetmaster18-Dec-04 0:01 
GeneralRe: Custom Control Tutorial Pin
Mekong River18-Dec-04 5:17
Mekong River18-Dec-04 5:17 
GeneralDAO connection Pin
paykani17-Dec-04 19:58
paykani17-Dec-04 19:58 
GeneralRe: DAO connection Pin
Mekong River18-Dec-04 5:27
Mekong River18-Dec-04 5:27 
Generalprogress bar Pin
WartHog00017-Dec-04 14:19
WartHog00017-Dec-04 14:19 
GeneralRe: progress bar Pin
Mekong River18-Dec-04 5:41
Mekong River18-Dec-04 5:41 
GeneralRe: progress bar Pin
WartHog00018-Dec-04 7:04
WartHog00018-Dec-04 7:04 
GeneralDatabase -- What am i not understanding. Pin
OICU81217-Dec-04 12:21
OICU81217-Dec-04 12:21 
GeneralRe: Database -- What am i not understanding. Pin
Dave Kreskowiak17-Dec-04 14:14
mveDave Kreskowiak17-Dec-04 14:14 
GeneralRe: Database -- What am i not understanding. Pin
OICU81217-Dec-04 18:57
OICU81217-Dec-04 18:57 
GeneralBitmaps and GDI+ Pin
Michael Parkin17-Dec-04 10:10
Michael Parkin17-Dec-04 10:10 
Generalcustom sorting datatables Pin
mfriedenthal17-Dec-04 8:07
sussmfriedenthal17-Dec-04 8:07 
GeneralRe: custom sorting datatables Pin
OICU81217-Dec-04 11:23
OICU81217-Dec-04 11:23 
GeneralRe: custom sorting datatables Pin
LadyReader20-Dec-04 4:41
LadyReader20-Dec-04 4:41 
GeneralRe: custom sorting datatables Pin
OICU81221-Dec-04 21:13
OICU81221-Dec-04 21:13 
GeneralRe: custom sorting datatables Pin
LadyReader22-Dec-04 4:16
LadyReader22-Dec-04 4:16 
GeneralCheck the file os open or not in vb Pin
Member 158672017-Dec-04 3:18
Member 158672017-Dec-04 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.