Obj files? Will I need to create Dat2ObjTexNorm.py?

Information, contacts and source code for ports to Linux, Windows, etc.

Moderators: winston, another_commander

SarahC
Poor
Poor
Posts: 5
Joined: Wed Oct 25, 2017 2:16 am

Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by SarahC »

Hi everyone!

I've made a little webpage page that spins some classic ships around, all in software:
https://codepen.io/SarahC/pen/QqobmO

And a super naive converter (it just scans for keywords, and stops at brackets) for VRML 2 to JavaScript ship declarations:
https://codepen.io/SarahC/pen/yzZKWN
https://codepen.io/SarahC/pen/pWYJKV


I've had a go at converting the Dat files in Oolite to Obj files, using Dat2ObjTex.py ((C) Giles Williams 2005)
The results so far are ok,
https://codepen.io/SarahC/pen/PJvzRm?editors=0010

But that Python code only handles simple ships, and one texture... it fails for the more complex Dat files. =(

Are there Obj/Texture files out there for the standard Oolite ships?
Or does someone have a reverse version of Obj2DatTexNormal.py?

I was aiming of a sandboxed Chrome fullscreen instance, with the WebGL page showing the ships zooming in and out, as a screensaver for Windows. Saves me tackling SlickDX in Visual Studio!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6680
Joined: Wed Feb 28, 2007 7:54 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by another_commander »

Hi and welcome!
Are there Obj/Texture files out there for the standard Oolite ships?
Yes there are. Object files for all the new models can be found in the oolite-assets repository on github. Follow this link: https://github.com/OoliteProject/oolite ... t-1.80-obj
The corresponding textures are the same ones that can be found in the Resources/Textures folder of your Oolite distribution.

As for a converter utility, I don't think that there is anything maintained today beyond Ob2DatTexNormal.py. But hopefully the object files will be sufficient to achieve what you want.
SarahC
Poor
Poor
Posts: 5
Joined: Wed Oct 25, 2017 2:16 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by SarahC »

another_commander wrote: Wed Oct 25, 2017 9:00 am
Hi and welcome!
Hiyah!

Thanks for the link - perfect, just what I needed.

The Cobra - Mark 3 diffuse.png file seems to be multi layered... I open it in photoshop and there's just a very subtle black and white shading texture, with none of the hull's green and blue to be seen!

I think it's a special PNG because several programs can't handle it: https://imgur.com/a/QVNuC

Do you know anything about it? I may have got the wrong end of the stick.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6680
Joined: Wed Feb 28, 2007 7:54 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by another_commander »

SarahC wrote: Wed Oct 25, 2017 9:30 am
The Cobra - Mark 3 diffuse.png file seems to be multi layered... I open it in photoshop and there's just a very subtle black and white shading texture, with none of the hull's green and blue to be seen!

I think it's a special PNG because several programs can't handle it: https://imgur.com/a/QVNuC

Do you know anything about it? I may have got the wrong end of the stick.
All textures in the post-1.80 models look similar. The reason is that the emission map is embedded in the png's alpha channel. You will need an image processing program capable of separating a texture's individual channels in order to view it porperly.
SarahC
Poor
Poor
Posts: 5
Joined: Wed Oct 25, 2017 2:16 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by SarahC »

another_commander wrote: Wed Oct 25, 2017 9:53 am
All textures in the post-1.80 models look similar. The reason is that the emission map is embedded in the png's alpha channel. You will need an image processing program capable of separating a texture's individual channels in order to view it porperly.
I see, thanks!

It's hidden away in Photoshop - selecting the "Channels" window shows the RGB channels AFTER the transparency has been applied, we want it BEFORE.

To do this:

Select the layer, then go to Layer menu -> Layer Mask -> From Transparency.

The alpha channel is extracted into a greyscale mask attached to the diffuse layer, which is now an opaque RGB layer.
To see the opaque layer on its own - disable the mask layer.

To see the mask as an "Emission" layer, holding left Alt key, and clicking the greyscale alpha mask layer that is linked to the diffuse layer will show only the alpha channel - the emissive parts in white.
SarahC
Poor
Poor
Posts: 5
Joined: Wed Oct 25, 2017 2:16 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by SarahC »

Sorted!

Thanks for your help.

https://codepen.io/SarahC/pen/PJvzRm
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by Diziet Sma »

SarahC wrote: Fri Oct 27, 2017 1:36 am

Looks good! Took me a moment to realise it was mouse-interactive, though.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
SarahC
Poor
Poor
Posts: 5
Joined: Wed Oct 25, 2017 2:16 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by SarahC »

Next stop - online OOLite!

The source already has the ship AI in JavaScript too!
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by maik »

Hello and welcome! Grondilu started a WebGL effort as well, you might want to get in touch. Also, the “Porting to other platforms” forum is a better place for this.

Looking forward to seeing more of your work!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6680
Joined: Wed Feb 28, 2007 7:54 am

Re: Obj files? Will I need to create Dat2ObjTexNorm.py?

Post by another_commander »

Topic moved to Porting to Other Platforms.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

3D models of Elite/Oolite Ships

Post by Cholmondely »

Just came across this: https://www.thingiverse.com/thing:4098763 by SarahC_ January 12, 2020

For making 3D models of Elite/Oolite ships
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 640
Joined: Sat Dec 04, 2021 11:01 pm

Re: 3D models of Elite/Oolite Ships

Post by Old Murgh »

Cholmondely wrote: Sun Aug 07, 2022 9:00 pm
Just came across this: https://www.thingiverse.com/thing:4098763 by SarahC_ January 12, 2020

For making 3D models of Elite/Oolite ships
Fixed that url for you: Ultimate Classic Elite Ship Maker.
Yes, cool idea. Is it becoming common to have a 3D printer with one's PCs too?
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: 3D models of Elite/Oolite Ships

Post by Cody »

Old Murgh wrote: Sun Aug 07, 2022 9:30 pm
Is it becoming common to have a 3D printer with one's PCs too?
Probably! Bet a 3D printer can't make one of these...

Image

Other views here: http://www.ianlawrencemodels.com/cobramkIII.html
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 640
Joined: Sat Dec 04, 2021 11:01 pm

Re: 3D models of Elite/Oolite Ships

Post by Old Murgh »

Cody wrote: Mon Aug 08, 2022 11:24 am
Probably! Bet a 3D printer can't make one of these...
No, not with that level of tender craftsmanship..
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1422
Joined: Thu Aug 27, 2015 4:24 pm

Re: 3D models of Elite/Oolite Ships

Post by cbr »

Cody wrote: Mon Aug 08, 2022 11:24 am
Bet a 3D printer can't make one of these...
I think they probably can...

https://www.thingiverse.com/thing:2860481

But you need a good model(ler)
Post Reply