Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any interest in an unofficial normals extension for AC3D #996

Open
gordonshamway23 opened this issue Nov 12, 2020 · 0 comments
Open

Any interest in an unofficial normals extension for AC3D #996

gordonshamway23 opened this issue Nov 12, 2020 · 0 comments

Comments

@gordonshamway23
Copy link

Hallo,

I dont't have a real issue with osg, but more or less a question.
I made an extension for the osg ac plugin, which is responsible for importing 3d model in the AC3D format.
The extension I made is already programmed, tested and working. The intention of my extension is to add functionality for specifying normals in *.ac model files explicitly. As of now normals can not be specified in AC3D files, but will be calculated automatically from vertices after parsing an ac file. This is done by taking adjacent vertices into account to calculate a smooth normal of a vertex. This is ok for most situations but having full control over normals for each vertex can help increase quality of 3D models, especially when modeling hard surfaces. So the problem is, the addition I made to the AC3D file format, is not officially supported by the standard and I can totally understand if you are not interested in such an addon. Now you can ask why do I want to get this extension in the osg repository. The answer is Flightgear :). As you all will know Flightgear makes heavy if not exclusive use of the AC3D format for loading aircraft models. So having this extension in the official osg build can help Flightgear to make Aircrafts look better in future. So I would like to know what you think about that?

Some more facts about my extension:
1, The extension is made in a way which is fully compatible with existing *.ac files. So parsing ac file without explicit normals is completely fine. It is therefore optional to use normals at all.
2. In code I used a macro EXPLICIT_VERTEX_NORMAL_EXTENSION which allows to completly include or remove the extension code to/from compilation. It does make the code a little ugly though, but it is nice to have, to see the unofficial additions to the ac plugin.

Here are some files describing the AC3D file format with and without my extension.

ac3d_file_format_2003_with_expilicit_normals.txt
ac3d_file_format_2017_Nicolatis.txt
ac3d_file_format_2017_Nicolatis_with_expilicit_normals.txt
ac3d_file_format_2003.txt

And here the code of the plugin, just two files, my extension (ac3d.cpp) and the original code(ac3d_original.cpp).
Sorry I had to zip it.

ac3d.zip

Feel free to have a look and I would be very happy to contribute it. I can easily make a pull request if you are interested.

Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant