Forums » Helicopters - Air Combat » General - Combat Helicopter Simulations » .obj to 3dz text for Gunship!

Topic Options
Rate This Topic
Hop to:
#2681853 - 02/27/09 08:12 PM .obj to 3dz text for Gunship!
samovar6 Offline
SimHQ Member

Registered: 02/16/05
Posts: 157
Loc: Canaduh
Here's a link to a utility that'll crank out a .3dz text file from a Wavefront obj. (Some restrictions apply)

obj3dztxt

The outputted text file won't have an Normals Sector. You can use 3dzStudio for that.

It also (of course) won't have a Sequence Sector. You'll have to use either Gurney's or WB's Sequencer to provide that. Another option would be tackling the RS with your own large brain.

There's a few freeware modelling programs that can create .obj files. Wings 3d is particularly interesting because it supports n-gons. Much easier on the poly-count than triangle-based programs. Wings may take a while to get used to, but it's absolutely worth the effort, imho.

You would still have to use 3dzStudio eventually, but much work could be more easily accomplished within other programs, especially if you're building a model from scratch.





Edited by samovar6 (02/28/09 12:33 PM)
Edit Reason: Mistakenly typed "Element" instead of "Normals."

Top Bookmark and Share
#2687485 - 03/08/09 07:31 PM Re: .obj to 3dz text for Gunship! [Re: samovar6]
samovar6 Offline
SimHQ Member

Registered: 02/16/05
Posts: 157
Loc: Canaduh
If anyone is interested in building models for GS, here's something that I posted a few days ago for the the benefit of a fellow in the EAW forum...


Let me make it clear that it’s not my intention to knock 3dzStudio. I’m a fan of the program. It’d be very tough to build and edit .3dzs without it.

However, if you’ve only built .3dzs from scratch in 3dzStudio, you should try creating an .obj model in another program, and then convert it to a .3dz using obj3dzTxt and Converter 1.8a. You might be able to spare yourself some work. If you only want to edit an existing .3dz, just stick with the Studio.

What follows is an extremely simple example using Wings 3d. You should be able to use any modelling program you like, provided that it will save/export as .obj.

This isn’t meant to be a tutorial, so not much will be explained. The thing to pay attention to is the click-count. It should demonstrate that it may be possible to save a great deal of time when building a model (even one as simple as this), if you use a program that has a few more features than 3dzStudio.

In the interest of full disclosure, I’ll confess that the clicks/keyboard commands involved with rotating the view won’t be included in the click-count. There will also be various undocumented mouse movements.(Just like in my basement, sometimes.)


A Simple Bullet Shape (looks more like a stubby pencil, but that doesn‘t sound the least bit dangerous):

Create cone: 2 clicks
Prior to creating the cone, I could’ve entered values for the number of Sections, Height, X diam, and Y diam. I just went with the default values.

Rotate cone -90 degrees along X axis to make it horizontal: 4 clicks

Extrude base of cone along Z axis: 8 clicks.



That’s it for the wire frame. I warmed you it was going to be a very simple model. Basically, it took 14 clicks. Less than a minute to do. I know it would take me longer much longer than that in 3dzStudio.

On to texture mapping:
If I had a texture, I would load it in and begin mapping. If desired, polys can be selected and mapped one-at-a-time, or they can be done in groups of contiguous polys that get unfolded into a 2-d mesh. The mesh can be moved, scaled, rotated, etc. Individual points within the mesh can be moved if warping is required.

Since I don’t have a texture for this model, I can create a basic unfilled one that minimizes or avoids warping altogether.

Chart and mark cuts for unfolding: 19 clicks
This creates three mapping groups.



The lettering pattern is the default background at this stage. It helps let you see whether there’s any warping. The letters in the conical part are on an angle, but they’re not extremely distorted. Had I wished, I could have rotated that mapping group of polys to straighten them out. BTW, I could’ve moved any of the three groups around, scaled them, etc. I’m okay with things as they are, so I’ll create and save the texture. All the polys in the model will be automatically mapped to it.

Create texture: 3 clicks

The default background disappears and a b&w texture is created.



Here’s the completed model:



Doesn’t look much different from the first pic in this post, does it? It’s hard to be certain anymore if it’s really been mapped properly because the texture is just b&w outlines of all the polys. I’ll add a few letters to the cylindrical part of the exported texture later, for demonstration purposes.

Export texture as .bmp: 6 clicks (not including typing in a name)

Export model as a Wavefront .obj file: 4 clicks (not including typing in a name)

Total time to make and texture-map model: less than 5 minutes with less than 50 clicks.


I convert the exported .bmp texture to a .pcx and add some letters to the cylindrical section using a graphics editor.




Next, I place the exported .obj file in the same folder as obj3dzTxt.exe, and run the utility. It tells me that the model is 61.13 3dz points long. I’ll scale up by a factor of 5. The 3dz should end up being around 306 points long.

After placing the 3dz text file output from obj3dzTxt and the texture.pcx (which I renamed to “your.pcx”) in the same folder as Converter 1.8a, I run Converter 1.8a in Text to 3dz mode. Double-clicking the newly-created .3dz opens it in 3dzStudio:



Looks okay.
All Normals can be recalculated now. Element types can be changed, hard points and action codes can be added, etc.

But how often will a person be making stubby pencils, or similarly austere models? Rarely, I should think. As previously mentioned, this was not meant to be a tutorial, so the model was kept very simplistic for brevity's sake. (The “brief” idea didn‘t really pan out, if you haven‘t noticed.) Very few of the features of Wings 3d were used. You’re just going to have to take my word for it when I say that you can make relatively complex models fairly quickly in many 3d-modelling programs.

And once more, as a reminder, you should be able to use whichever modelling program you like, as long as it will export/save .obj files.



NEW STUFF:

I changed obj3dztxt.exe so that all the elements in the text output are now Type 05 elements.

Also, 3dztxt2obj.exe was added to the .zip. The program will convert a .3dz text file to an .obj model. I don't know why you'd need this, but an EAW player expressed an interest in such a program.




Edited by samovar6 (03/12/09 06:13 PM)
Edit Reason: Removed whiny bits. I don't think that I was whining, but some people may have thought so. I blame it on my difficutlies with English. Sadly, English is my native tongue.

Top Bookmark and Share
#2687590 - 03/09/09 03:22 AM Re: .obj to 3dz text for Gunship! [Re: samovar6]
Polak Offline
SimHQ Senior Member

Registered: 05/26/01
Posts: 5291
Loc: New York, NY
Quote:
Hey, Polak, you've might've already noticed this, but I feel that I should let you know, anyway. Guilt is a wonderful thing.

Samovar6,
you should never feel guilty about anything here. I feel guilt though, that lately I do not contribute anything. Muses abandoned me. Or ...middle age crisis. old_simmer

Top Bookmark and Share
#2689941 - 03/12/09 06:29 PM Re: .obj to 3dz text for Gunship! [Re: Polak]
samovar6 Offline
SimHQ Member

Registered: 02/16/05
Posts: 157
Loc: Canaduh
Hi, Polak,

I wasn't feeling guilty about the post. I felt bad that the .3db program might've been flawed. Somewhow, I wound up using an early and incomplete version of the .3db utility. Guess I oughta' clean my machine more often. You needn't worry about that tool. .mtl filenames should be okay.

My post has been edited so that the bit that you quoted isn't in it anymore. Sorry 'bout that.

Also sorry to hear about your mid-life crisis. Maybe you can get Senior's discounts now with the neighbourhood merchants. (Just trying to put a positive spin on the aging thing.)

Cheers!

Top Bookmark and Share
#2695389 - 03/21/09 07:43 AM Re: .obj to 3dz text for Gunship! [Re: samovar6]
samovar6 Offline
SimHQ Member

Registered: 02/16/05
Posts: 157
Loc: Canaduh
Fixed a bug in 3dztxt2obj. It can be downloaded from here:

17MARobj3dz

Top Bookmark and Share



Forum Use Agreement | Privacy Statement | SimHQ Staff
Copyright 2009, SimHQ Inc. All Rights Reserved.