inexorgame-obsolete / deprecated-cube-engine-inexor

UNMAINTAINED: Please have a look at the vulkan-renderer
https://inexor.org
zlib License
11 stars 1 forks source link

Make models importable to octree #474

Open a-teammate opened 6 years ago

a-teammate commented 6 years ago

Currently the other way around is already supported: there is a way to export a map to a .obj file containing static geometry info + metainfo like textures. There will probably get some details lost. That's okay, the octree is not perfect. (Depending on our other octree improvements this error could be decreased).

Use cases for this are:

On another note this advanced math code (clip 3D points to octree points) could get used to rotate and spin octrees in less than 90 degree steps.

There are probably already papers for similar math code. (I slightly remember one which handled a similar topic, when looking for automatic ways to generate low-poly models from high-poly ones. cant find it currently.. Will probably be doable in multiple ways anyways.)

IAmNotHanni commented 6 years ago

I believe there is already an implementation for importing .obj to octree in the cm edition client: https://sourceforge.net/projects/cmsauerbraten/ https://www.youtube.com/watch?v=bHa9MK-lxUI

a-teammate commented 6 years ago

awesome! now that algorithm has to be made bulletproof (there are some glitches in the video, dunno if that was fixed lateron). thats maybe a lot of work, too.

Furthermore the algorithm has to get extended to the UV map as well, so we have textured models.

This is a very nice proof-of-concept though! :)

aschaeffer commented 6 years ago

A few years ago I've ported that marching cubes algorithm to LUA (see here and here) in order to generate 4D maps (a cave concept map). Basically the cubes have been constructed from an abstract 4D noise map (means we have a density value for cartesian coordinates (x, y, z)) when the density value is above a threshold. For map generatation the results are o.k., but for importing 3D models they may be a bit rough. But yes, it works.

tdphette commented 6 years ago

This is the type of editing enhancements I was working on in the original sauerbraten, so I'll take a stab at implementing this. -protothad