autopawn / 3d-ascii-viewer Goto Github PK
View Code? Open in Web Editor NEWViewer of 3D models in ASCII without graphic libraries.
License: MIT License
Viewer of 3D models in ASCII without graphic libraries.
License: MIT License
Many people have asked to include specific models in the models/
folders.
However, each model is subject to its own license. All the models I have included so far are Public Domain (the authors are listed in the README).
I want to keep the repo MIT licensed (permissive) but there are many models that we would want to include that are either Creative Commons (often attribution required) or GPL (copyleft). So in theory we shouldn't distribute them as part of a MIT licensed project, because the license is incompatible.
Since I am not more familiar with legal stuff. I wonder if there is a correct way we can add to these models to the repo, perhaps including them in their own folder within models/
with their respective license, and adding a disclaimer in the README
that not all models in models/
are MIT licensed or Public domain.
It would be nice if someone with more knowledge in this regard could give some advice.
If this is not possible or recommended, we could may install an "at least MIT licensed" policy for adding models or refer to a separate project that keeps track of them.
how hard would it be to support loading png or svg and display them in 3d?
i have created this using some online web service from a 2d image
http://sid.ethz.ch/debian/3d-ascii-viewer-c/debian.obj
As argp.h is part of GNU libc, currently the code only compiles on Linux as is.
On FreeBSD for example, there is a package called argp-standalone
for portability, used by Firefox and ffmpeg, which requires:
-I/usr/local/include
(or better -I$(PREFIX)/include
) to get /usr/local/include/argp.h-largp
to link against the libraryNot sure for the small arguments parsing done that this dependency is worthwhile, as it creates issues of portability for 4 small and simple options. As is, the Makefile only works on Linux.
On Mac OS X, brew also provides argp-standalone, so I guess it will be the same issue for all other OSes.
I found some cool obj files at http://sid.ethz.ch/debian/3d-ascii-viewer-c/ that can be used with 3d-ascii-viewer-c.
would it be possible to implement zoom in/out with +/- in interactive mode?
so i've tried to make the terminal very large on a 16:9 screen, and the knight gets really fat:
./viewer -h $LINES -w $(echo $COLUMNS-1|bc) /usr/share/games/brutalchess/models/knight.obj
is there a way to not stretch the object? well probably not. it's 3d, but fonts are usually double high than wide (+/-), depending on the font, and screen/resolution (pixels being square or not, visible with circles)
src/surface.c:4:10: fatal error: ncurses.h: No such file or directory
4 | #include <ncurses.h>
| ^~~~~~~~~~~
compilation terminated.
On Debian, it requires for example the package libncurses-dev
Compiled like described in #1.
❯ ./viewer models/fox.obj
zsh: segmentation fault (core dumped) ./viewer models/fox.obj
❯ lldb viewer
(lldb) run models/fox.obj
Process 79110 launched: '/datacube/ascii-sandbox/3d-ascii-viewer-c/viewer' (x86_64)
Process 79110 stopped
* thread #1, name = 'viewer', stop reason = signal SIGSEGV: invalid address (fault address: 0x2)
frame #0: 0x00000000002032f8 viewer`model_add_vertex + 40
viewer`model_add_vertex:
-> 0x2032f8 <+40>: movl (%rax), %eax
0x2032fa <+42>: movq -0x28(%rbp), %rcx
0x2032fe <+46>: cmpl 0x4(%rcx), %eax
0x203301 <+49>: jne 0x203366 ; <+150>
I've the same stacktrace when compiling with -g to enable debug symbols.
This is this method:
static void model_add_vertex(struct model *model, vec3 vec)
{
if (model->vertex_count == model->vertex_capacity)
{
model->vertex_capacity *= 2;
if (!(model->vertexes = realloc(model->vertexes, model->vertex_capacity * sizeof(*model->vertexes))))
{
fprintf(stderr, "ERROR: Memory allocation failure.\n");
exit(1);
}
}
model->vertexes[model->vertex_count] = vec;
model->vertex_count++;
}
Stacktrace:
* frame #0: 0x000000000020343c viewer`model_add_vertex(model=0x0000000000000002, vec=(x = 0.315012991, y = 1.986498, z = 0.311190993)) at model.c:40:41
frame #1: 0x00000000002030e4 viewer`model_load_from_obj(fname="models/fox.obj") at model.c:283:13
frame #2: 0x0000000000203c10 viewer`main + 112
frame #3: 0x0000000000202920 viewer`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:75:7
The model
address is 0x2 (confirmed with lldb and with a printf("Address for model: %p\n", model);
)
check this out! https://www.taat.fi/tmdc/ (i like the tmdc 3 invtro, could not find youtube video of it, maybe works in dosbox)
do you know of a huge archive of free to get obj models?
meshlab is great for converting to obj from other formats (like stl)
and... debian package: http://sid.ethz.ch/debian/3d-ascii-viewer-c/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.