-
Notifications
You must be signed in to change notification settings - Fork 10
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
Tools.hpp missing? #2
Comments
its a template file for many of my tools like the cAABBCC used here? its not specific, you can use other AABBCC on internet |
Hi, I am looking for an easy way to export magicavoxel files from my scripts, and I was hoping I could get this working out of the box, it looks very complete. Could you provide another clue for what the Also the header apparently defines a macro Thanks. |
you are lucky :) |
Neat! Thanks! |
@aiekick Could you comment on what format or what tool consumes the vox.hm file? It seems to be a human readable descriptor for the .vox binary format itself. |
vox.hm is the file format descriptor for HexaMonkey : updated in readme |
That’s awesome! Thanks! I hacked on it and got it compiling, took me about 15 mins. Thanks for your help! I’ll fork, incorporate your other repo, and push my compiling changes soon. I still have yet to really test the code heavily but so far this is by far the most complete .vox code I’ve found so far. |
thanks ahah. its pleasant to do things usefull for others :) i have tested my version heavily. all the models you can found is this repo are geenrated with it : i successfully opened all my models. with it. by the way this file writer not create all types of chunks. but you can add from the file format via reverse ingeneering, using hexamonkey :) |
That's awesome. How is surpassing 126^3 achieved in that example? Looking at the VoxWriter.cpp, 497 // the limit of magicavoxel is 127 because the first is 1 not 0
498 // so this is 0 to 126
499 m_LimitX = min(vLimitX, 126);
500 m_LimitY = min(vLimitY, 126);
501 m_LimitZ = min(vLimitZ, 126); had me worried that trying to go beyond 126 would be pointless with VoxWriter. But I will test it out shortly and see what happens. |
the limit of MV is to have 127 cubes. but his first index is 1 you will see that when you will work with colors : |
you dont have to take care of what is the limit of a cube. VoxWriter::AddVoxel(uint32_t vX, uint32_t vY, uint32_t vZ, uint8_t vColorIndex) you can also AddColor before and use an index you can use in AddVoxel func too |
Cool, I'll play around with it. As promised, here is where I'll be putting my changes to get the tool working for me: https://github.com/unphased/MagicaVoxel_File_Writer Sorry in advance for butchering your code. Git wouldn't let me merge the two independent trees wholesale so I went and did it anyway using a chain of cherry-picks. Haha. I just wanted all the dependencies together in one repo so I can build it easily. I'll probably write a makefile for it and keep hacking if there's more stuff missing. Also check out my topic here: ephtracy/ephtracy.github.io#146 Thanks! Also I'm looking forward to eventually playing with the SDF thing you're making! Super cool. |
no problem do what you need with my code. its free :) i plan to make it lib free, so maybe incorporate cAABBCC in code. but not time for it for the moment. thanks too :) |
You're right this works out of the box, you have really got the format figured out. #include "VoxWriter.h"
int main() {
vox::VoxWriter vox(1200,1200,300);
for (int i=0; i<1000; ++i) {
for (int j=0; j<1000; ++j) {
vox.AddVoxel(i,j, floor(sin((float)(i * i + j * j) / 50000) * 150) + 150,(i+j)%255 + 1);
}
}
vox.SaveToFile("output_voxwriter.vox");
} This is a staggering quantity of voxels. Looks like I pushed it past a threshold, if I go into render mode it only renders a region in the center. Anyway this will do quite nicely for me. |
Interestingly when I had the ~1 million voxels spread across z from 0 to 100 (instead of 0 to 300) it was fine rendering everything. some internal limitation I suppose. Also interesting, a full 126^3 model is twice as many voxels as that. I can't wait for 256^3! OK I'll try to stop geeking out over MV now. |
@aiekick Hey dude I noticed an off-by-one positive-zero-negative-zero-rounding bug that I'm not sure which code (this code or MV) has, but I can see that the blocks adjacent to the X and Y axes are overlapping by a single voxel. you can see the seams. I was hoping to catch stuff like this by generating the sine based curve. |
indeed . i dont knpw where can be the bug. i think its in my format but where ? :) |
It reminds me of some kind of rounding behavior. Usually if you cast a float to an integer, 1.99f -> 1, -1.99 -> -1, and correspondingly, 0.99 -> 0, -0.99 -> -0. Notice how the entire range (-1,1) rounds to a form of floating point zero, which both become zero for an integer. Conversion to integer from a float, especially if you want to ensure high performance, is tricky to get right. I'll let you know what the fix is in a bit. Sorry for not opening a separate issue for this bug I found. |
yep, it hink i have resolved the issue. no problem for the specific thread of issue :) you are the only one who speak to me about issue regarding this file in deep. like if it interest no one except you haha Commit done :) |
now lib free. ct tools extracted from https://github.com/aiekick/cTools a bit of refactoring also added a cmake file added a sample of main.cpp from a example of @unphased see issue #2
ha i not fiexd that like that maybe i have again an issue haha what is your ide ? |
I use vim and tmux :)
Well voxels are definitely the future in gamedev and I think people are starting to figure it out... essentially, Minecraft wasn't a fluke. I got kinda inspired recently by this guy's blog: http://procworld.blogspot.com where he did a lot of awesome exploratory work back in 2011/2012 on voxel worlds. And MV is such a cool piece of software. I'm doing some stuff with voxels for work, I work for a robotics company. We do voxel based volumetric geometry stuff. |
haha vim is for pure coder :) nice i choose simplicity, visual studio on win and clion for the others os :) but its not free btw for this class i think we can improved it and add stuff like layers, and animation in a easy way voxels can also be used for fluid computations :) |
I have really been impressed a lot by VS Code. The C++ plugin it provides is very very good. I would use it if it had better vim emulation, and I do use it for work when I am on a machine that is not mine. But for most of my work I stick with vim because I have a lot of plugins I use that fit in with its philosophy, and it is very fast and convenient to stay inside the terminal all the time. I heard great things about clion but these days VS Code will get the job done and has a great community making plugins to make your life better. Do you know if/how MV supports animation? Yeah layers would be nice, but I personally have no need for features like that yet! I love fluid simulation as well, I had a naiver stokes solver I made in college and it ran well on a CPU because I used conjugate gradient. that was before it became so easy nowadays to code algorithms on GPUs. You are absolutely right about the voxel -> fluids connection. Exciting times. By the way I tried your latest commit because I saw that you made a lot of improvements that supersede my hacks. However it does not build for me because of some more missing dependencies and stuff, so unfortunately I am pushing forward on the XYZP to VOX converter command line tool in my branch for the time being.
it looks like also that c++11 isnt enabled for your cmake config. |
arf visual sutdio not produce errors, i saw it ignore unused code. as mingw32 block. i would ike to converts my simu in 3d like this one : https://www.shadertoy.com/view/3dsyRl |
corrected :) |
Awesome! Nice shader!! |
thanks. its my hobby :) i love all procedural stuff, or art via programming |
Not sure what it is but it seems to be missing?
The text was updated successfully, but these errors were encountered: