SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Modern-Era Subsims > Dangerous Waters > DW Mod Workshop
Forget password? Reset here

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-09-18, 12:18 PM   #1
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

I can provide enough info on the format to allow you to write a viewer/exporter.
I've only looked at it for a few hours so still figuring out the last bit of unknowns. One could write a new exporter for 3D Max or other programs once I figure it all out.


Thank you TLAM Strike for a few models I downloaded to look at the structure.
Those were a great source to work with.

Last edited by Jeff-Groves; 11-09-18 at 12:39 PM.
Jeff-Groves is offline   Reply With Quote
Old 11-09-18, 01:45 PM   #2
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

Looking at the P4_Midget_Sub j3d file header in SweetScape 010 We have this:
EB 0F 00 00 EC 0E 00 00 02 00 00 00 12 00 00 00
10 00 00 00

EB 0F 00 00 as an integer is 4075. That is the number of verts in the j3d file.

EC 0E 00 00 as an integer is 3820. That is the number of polys in the j3d file.

02 00 00 as a short is 2. That is the number of textures used by the j3d file.

12 00 00 00 as a short is 18. That is the number of 3d models in the j3d file.

10 00 00 00 as a short is 16. That is the number of texture mappings in the j3d file.

So we have 4075 verts, 3820 polys, 2 textures, 18 3d models, and 16 texture mappings.

The next stuff is all the verts and texture co-ords. I'll break that down in the next post as there is some info I am not sure of at this time.
Jeff-Groves is offline   Reply With Quote
Old 11-09-18, 02:35 PM   #3
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

Following the header I described is a large block of data which includes the vets and faces of the 3D objects. Let's look at a chunk of that.

66 4C 41 BC BB D2 66 BF 6A AA 68 C1 00 00 00 00
55 55 AD AE 40 CA 2B 38 00 00 80 BF 00 00 00 00
00 00 00 00 16 F5 09 3F

This chunk gives us the verts, an unknown I suspect may be tangents, and our texture co-ords. We read them all as floats.

66 4C 41 BC BB D2 66 BF 6A AA 68 C1 = v 0.011798 -0.901653 -14.541605

00 00 00 00 = seems always the same. maybe a divider?

55 55 AD AE 40 CA 2B 38 00 00 80 BF = unknown. Maybe tangents?

00 00 00 00 00 00 00 00 16 F5 09 3F = tex co-ords. 0.000000 0.000000 0.538996
This one is interesting as so far as I have found the 3rd co-ord of 0.538996 must be subtracted from 1 to get the proper number.
Then moved to the secondary position on export! vt 0.000000 0.461104 0.000000

If someone could send me a couple of the Games original 3D files that may help.

Last edited by Jeff-Groves; 11-09-18 at 03:10 PM.
Jeff-Groves is offline   Reply With Quote
Old 11-09-18, 03:57 PM   #4
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

A template and script to work with j3d files is being created.
However. I am creating a special file to work with those that will require you to buy a legal copy of SweetScapes 010 Hex Editor.

I put a lot of time in to help with stuff. SweetScape has the best hex editor out there!
I support them and they add nearly anything requested. Spend a few bucks to support a great bit of software! 010 is the best tool a modder can own!
Jeff-Groves is offline   Reply With Quote
Old 11-09-18, 04:24 PM   #5
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

Now. After all the above stuff we come to the faces.
It's all pretty boring to me but you all want the information.
What happens with the j3d file is ALL verts and tex info is one large block with no separation of models. YET!
Now we look at the faces needed. Those also run as one large block with separation coming later in the file.
Jeff-Groves is offline   Reply With Quote
Old 11-10-18, 04:36 PM   #6
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

Again looking at the P4_Midget_Sub in 010 I jump to the faces section.
I get the jump address by multiplying the number of verts (4075) by 40 (which is the number of bytes in the chunk which gives us the verts and tex co-ords stuff) then add 20 for the header block.

I work with the 3DS file provided and export it from 3DS Max as an obj file.
3D Converter will also export as an obj if you have a registered version.
The trial will drop every 5th vert info. $50 USD for lifetime upgrades is a deal. And yes I have a registered version.
Jeff-Groves is offline   Reply With Quote
Old 11-10-18, 04:58 PM   #7
Jeff-Groves
GLOBAL MODDING TERRORIST
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,655
Downloads: 137
Uploads: 0


Default

One thing that will make it easier to read and match the j3d file info to the exported obj file is to rotate the model on export.

Now the faces info.

If you jumped to position 163020 decimal your at the start of the faces info.
You will see:
01 00 02 00 00 00 02 00 03 00 00 00 03 00 04 00
00 00 04 00 05 00 00 00 05 00 06 00 00 00 06 00
Blah blah blah.

ADD 1 to each Short. So 01 00 should be converted to 2 for export.
02 00 would be 3, 03 00 would be 4, and on and on.

The current export options accumulate all the faces info! You will hit the
01 00 02 00 00 00 02 00 03 00 00 00 03 00 04 00
00 00 04 00 05 00 00 00 05 00 06 00 00 00 06 00
Blah blah blah.
stuff 5 times in the example sub I am working with.
I suspect that is just objects imported during the building of the unit.
I'll check other files to see if this holds true.

So read the 01 00 02 00 00 00 as such for faces:
2/2 3/3 1/1

Current export options will give you:
1/1 2/2 3/3 and so on.

Last edited by Jeff-Groves; 11-10-18 at 05:07 PM.
Jeff-Groves is offline   Reply With Quote
Reply

Tags
j3d

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.