Great News ! I finally came with a 3D Studio Max scene exporter, using both Max Script and Ruby.
The idea is simple : all that I have to do is to create my 3D objects, LPM meshes using a unique texture mapped with Unwrap.
When created, those objects are placed on the top left corner of the top view axis. They are prefixed with "obj_", which will be used later.
After that, all I have to do is to copy those objects into my 3D Scene, which I decided to make start on the bottom right corner of the top view, making the origin (0.0, 0.0, 0.0) on the top left corner of the game window.
Copies from objects must be prefixed with "toDraw_".
When my scene is done, all I have to do is to run a MaxScript program I coded, which gives me a text file that describes the scene.
When I switch back to my Ruby-OpenGL program, it will load that file and :
- load any "obj_" file
- render any "toDraw_" copy using the propre obj_ file at the right position.
That way, I can use 3D Studio Max as a 3D editor ! This can be improved a lot, because cameras can as well be exported, and why not using that system to draw walkable paths and name them like "path_" ?
This is really a convenient system and so easy to implement ! It's so much easier that creating a full 3D editor that will never be as good as Max one.
What is still needed is to handle rotation, I have to figure out how quaternions work.
And don't be afraid about the video slowness, I captured the full screen of my computer which costs a lot.
great good job
but i mean opengl code if you do not mind i want to see that code
aslloook77 9 months ago
@aslloook77 : I see no problem in that. I really should write something about it, it seems like lots of people are in fact interested in that.
I'll see what I can do and share ASAP.
solidboko 9 months ago
thanks
do you have code in opengl do load 3d max file i need it please
aslloook77 9 months ago
@aslloook77 : this is not really a .max reader. This is a MaxScript that describes in a text file the scene in Max. I combine this with a .obj file reader to display the scene in a OpenGL context.
solidboko 9 months ago
Thanks a lot ! As always, not that hard to create, but kinda proud to have thought about it :)
solidboko 9 months ago