saccharineboi / cursedgl Goto Github PK
View Code? Open in Web Editor NEW3D graphics library for the terminal
License: GNU General Public License v3.0
3D graphics library for the terminal
License: GNU General Public License v3.0
Hey @saccharineboi this is a pretty amazing project!!! I'm honestly surprised why its not more popular.
In the future I kind of want to use this library to build some cool things on top, but for now I'd like to ask some questions/request some features.
One pretty cool thing I was wondering if possible was the ability to specify different ANSI character sets. For example, it seems you are rendering full blocks, but since you are using the notcurses backend would it be possible to add more options, such as vhalf blocks, sextant blocks, or the wedge blocks? Maybe even using more of the true image protocols like sixel, kitty, etc. Ideally, I imagine this to just be an option that is sent to notcurses rendering. Of course the speed will be slower, the more symbols that have to be rendered but I'm not particularly concerned about that right now and in any case, those optimizations should be done inside of notcurses itself.
Another thing that would be pretty neat would be showing the colors from the input OBJ files! I think the colors are part of the texture in the OBJ/MTL files, and it seems that you do have textures listed as a known issue. Going through the examples, you already seem to be able to specify color. It'd be pretty nice to have color support if the OBJ file supports it!
The first use case I'd like to start with when using this project would be to create a simple OBJ viewer for arbitrary ANSI resolutions and using the colors from the OBJ file instead of using say lighting via raytracing from light sources.
Thanks so much by the way for creating something like this, its pretty slick!
Compiling as-is (with GCC) on CentOS Stream 8 fails to link due to some weird error involving flto:
โ build git:(main) make
[ 3%] Building C object CMakeFiles/trex.dir/src/colors.c.o
[ 7%] Building C object CMakeFiles/trex.dir/src/framebuffer.c.o
[ 11%] Building C object CMakeFiles/trex.dir/src/init.c.o
[ 15%] Building C object CMakeFiles/trex.dir/src/lights.c.o
[ 19%] Building C object CMakeFiles/trex.dir/src/material.c.o
[ 23%] Building C object CMakeFiles/trex.dir/src/objLoader.c.o
[ 26%] Building C object CMakeFiles/trex.dir/src/rasterizer.c.o
[ 30%] Building C object CMakeFiles/trex.dir/src/shapes.c.o
[ 34%] Building C object CMakeFiles/trex.dir/src/transform.c.o
[ 38%] Linking C static library libtrex.a
/usr/bin/ar: CMakeFiles/trex.dir/src/colors.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/framebuffer.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/init.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/lights.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/material.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/objLoader.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/rasterizer.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/shapes.c.o: plugin needed to handle lto object
/usr/bin/ar: CMakeFiles/trex.dir/src/transform.c.o: plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(colors.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(framebuffer.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(init.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(lights.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(material.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(objLoader.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(rasterizer.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(shapes.c.o): plugin needed to handle lto object
/usr/bin/ranlib: libtrex.a(transform.c.o): plugin needed to handle lto object
[ 38%] Built target trex
[ 42%] Building C object CMakeFiles/hello_lines.dir/examples/hello_lines.c.o
[ 46%] Linking C executable hello_lines
/tmp/ccYGwPIa.ltrans0.ltrans.o: In function `main':
/home/username/dev/TRex/examples/hello_lines.c:118: undefined reference to `txInit'
[.. many more lines of this ..]
Based on this I was able to resolve this issue with 3 lines in CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46af16b..025fd1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ project(trex)
# C settings
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
+SET(CMAKE_AR "gcc-ar")
+SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcs <TARGET> <LINK_FLAGS> <OBJECTS>")
+SET(CMAKE_C_ARCHIVE_FINISH true)
list(APPEND CMAKE_C_FLAGS "-Wall \
-Wextra \
Not sure why this is needed on CentOS and not Ubuntu
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.