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-18-18, 09:22 PM   #31
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

So far doing a check does jump the header and get me right to the faces section.
Another odd file is the airdepthcharge.j3d
3D Object converter does not like that one.
Jeff-Groves is offline   Reply With Quote
Old 11-18-18, 09:36 PM   #32
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

Another thing is that in the example of type 212 which we have started this very intriguing conversation, animation parts like 212 periscope 1,2 , snorkel, radar or mentioned ecm antenna are not part of the main 212.j3d model . The sail is empty inside. Those parts seem to be called once the appropriate command is issued.
I believe this happens throughout all other models.
Polak2 is offline   Reply With Quote
Old 11-19-18, 07:12 AM   #33
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

Quote:
Another odd file is the airdepthcharge.j3d
3D Object converter does not like that one.
Not that this is of most importance, but I think that airdepthcharge.j3d is not used in the game. DWEdit has some nifty feature linking entities to their j3d models. Air deptcharge according to DwEdit uses depth.j3d and depth3.j3d which looks like the same models to me.
Polak2 is offline   Reply With Quote
Old 11-21-18, 12:21 AM   #34
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

As I get the time I'll write a script to export the info from the j3d files as is.
3D Object Converter just does not export all the info and I'd like to know the reason behind that.

I may wipe the old NoteBook and re-install Win 95 or so.
Then I could run the old 3D Studio and j3d exporter to see what the export options are.
Jeff-Groves is offline   Reply With Quote
Old 11-21-18, 06:59 AM   #35
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

Quote:
3D Object Converter just does not export all the info and I'd like to know the reason behind that.
I think 3DObject Converter takes all animated parts of surface units (usually guns, radars, torps) and bunches them to one single coordinate ....usually inside the hull so unless one switches to wireframe mode, one may never know that they are there...lol.
Polak2 is offline   Reply With Quote
Old 11-21-18, 06:56 PM   #36
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,425
Downloads: 131
Uploads: 0


Default

Quote:
Originally Posted by Polak2 View Post
I think 3DObject Converter takes all animated parts of surface units (usually guns, radars, torps) and bunches them to one single coordinate ....usually inside the hull so unless one switches to wireframe mode, one may never know that they are there...lol.
3D Object Converter seems to be skipping some verts in some cases.
Or maybe just optimizing them and condensing the files.
That's fine for what it does but does not help when looking at a possible new way to convert to the j3d format.

And I have seen the way things may be out of place in the files.
It's much like SH3/4 where the location connection to parent location is ignored by every exporter ever written.

That's due to the way any given exporter is coded.
If a part is assigned as a child of a part at say 1, 5, 9 in the X, Y, Z? Then it inherits that position in the Games.
IF that is not coded into the exporters? You get the true X Y Z but not the inherited position so the weird placement thing.

Last edited by Jeff-Groves; 11-21-18 at 07:06 PM.
Jeff-Groves is offline   Reply With Quote
Old 12-02-18, 05:21 AM   #37
Battlewagon3
Swabbie
 
Join Date: Apr 2018
Posts: 10
Downloads: 6
Uploads: 0
Default Thank you!

Quote:
Originally Posted by Jeff-Groves View Post
Here's the start of the 010 template for j3d files.
http://www.mediafire.com/file/f93une...bz/j3d.7z/file

This template will take you to the start of the faces.
It reads the file just as is!

I'm replying to thank you now before I forget. It could be a few months before I chase this down properly. I've been very busy learning how to code (really) for my studies, so games modding has taken a backseat. As you'll see from my other posts, though, every few months I come back with questions and try a few more things. I'm not ignoring you!
Battlewagon3 is offline   Reply With Quote
Old 12-19-23, 02:50 PM   #38
HoneyFox
Swabbie
 
Join Date: Nov 2014
Posts: 9
Downloads: 0
Uploads: 0
Default

I took several hours researching the j3d file format, and here is what I've found (see attachment).

It's written in C++ style, although C++ doesn't support declaring array of uncertain length, but... you get what I mean.

PS1: There are still some unknown items, but they seem to be constant during my research over dozens of .j3d files.
PS2: It's still far from having a new exporter. Major challenge is to find a suitable input model format and write a parser for it, especially when dealing with models containing hierarchy.
PS3: Actually I'm not sure if that use_tex and render_order is correct or not, I found no value to store the material index of model, but it doesn't seem to match if we assume it is.
Attached Files
File Type: txt J3DFileFormat.h.txt (1.2 KB, 7 views)

Last edited by HoneyFox; 12-19-23 at 10:52 PM.
HoneyFox is offline   Reply With Quote
Old 12-21-23, 09:34 AM   #39
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

Interesting work and progress.

Are you trying to make a new exporter plugin like DWj3dexporter2004 which has some limitations of polygons being able to export as well as being compatible with a very old version of 3dsMax?
I assume that you are aware that j3d is part of the 3D ObjectConverter and can load models but not save them back to j3d.

Perhaps there is something we can help with?

Last edited by Polak2; 12-22-23 at 02:26 PM.
Polak2 is offline   Reply With Quote
Old 12-22-23, 03:50 PM   #40
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

Perhaps of some help would be a structure of DW database where some of the j3d elements are mentioned.

I think it is included in DWEdit1_7_4_1 which was in DW Download section on this forum.
Polak2 is offline   Reply With Quote
Old 12-22-23, 06:22 PM   #41
HoneyFox
Swabbie
 
Join Date: Nov 2014
Posts: 9
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Polak2 View Post
Perhaps of some help would be a structure of DW database where some of the j3d elements are mentioned.

I think it is included in DWEdit1_7_4_1 which was in DW Download section on this forum.
Oh, my aim is to have a tool for exporting j3d models for JFC. I don't know if this file format has changed or not when it comes to DW.

Anyway this is the current workflow: modeling in Blender 3.x -> Blender 3.x Wavefront obj exporter (I modified the wavefront obj exporter so that the hierarchy/offset info can be exported as well) -> Wavefront obj file -> My exporter -> J3D file -> cmpUtils.exe -> GraphicsDB.

Too bad that subsim doesn't allow me to upload .zip file attachment...
HoneyFox is offline   Reply With Quote
Old 12-22-23, 08:12 PM   #42
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

Quote:
Originally Posted by HoneyFox View Post
Oh, my aim is to have a tool for exporting j3d models for JFC. I don't know if this file format has changed or not when it comes to DW.
Word of caution: as DW j3d plugin had a limit of 32K polys on the models it is very probable that JFC (being the earliest) would have some hard limits on 3D models as well. It was dictated by the HW in those days.
Polak2 is offline   Reply With Quote
Old 12-22-23, 11:10 PM   #43
HoneyFox
Swabbie
 
Join Date: Nov 2014
Posts: 9
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Polak2 View Post
Word of caution: as DW j3d plugin had a limit of 32K polys on the models it is very probable that JFC (being the earliest) would have some hard limits on 3D models as well. It was dictated by the HW in those days.
It's expected since the data structure mentioned in J3DFileFormat.h above has lots of items using “short"/"unsigned short” type, which implies that there will be a limit of 32768(if it's signed) or 65536(if it's unsigned) for both vertices and triangle faces. Similarly there is a limit of up to 128 textures and 256 or 128 materials since it's using "char" type, and up to 32 characters for names of objects in the model.

Luckily for JFC we don't really need that high poly count in most cases. DW's graphics quality is definitely in another level so exceeding-the-limit becomes more often.

Last edited by HoneyFox; 12-23-23 at 10:51 AM.
HoneyFox is offline   Reply With Quote
Old 12-23-23, 01:57 PM   #44
Polak2
Weps
 
Join Date: May 2005
Posts: 371
Downloads: 60
Uploads: 0


Default

There are not many differences between graphics (3D model-wise)for JFC and DW.



In fact, hardly any.

Which begs the question: are the JFC mission playable on DW? The interface of JFC is a little dated and so is the DW but not as much.
Polak2 is offline   Reply With Quote
Old 12-26-23, 10:56 AM   #45
HoneyFox
Swabbie
 
Join Date: Nov 2014
Posts: 9
Downloads: 0
Uploads: 0
Default

As someone requested, I've pushed my tool to github:
https://github.com/HoneyFox/J3DFileConverter

Feel free to fork/create merge requests.
HoneyFox is offline   Reply With Quote
Reply

Tags
j3d


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 07:09 PM.


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