makman2 / te3d Goto Github PK
View Code? Open in Web Editor NEWA 3D engine for the terminal.
License: GNU General Public License v3.0
A 3D engine for the terminal.
License: GNU General Public License v3.0
How about apple support? This should be relatively easy since it's a unix derivative.
Fix bugs and add triangle mode loading.
Just run
make codecheck
in src/ and you'll see code convention violations. These are to be solved.
And eventually omit rewriting control chars if not nessecary.
Use recursive make and generate makefiles. Should we use the GNU BUild system?
http://de.wikipedia.org/wiki/GNU_Build_System
Download this model:
http://www.blender-models.com/wp-content/uploads/2014/01/The-Lure-Breaker-3-2.blend
Export it to the wavefront obj format, rename it to "kinghearts.obj" and run the code below.
The funny thing about this bug is, when you're changing the scaling matrix to 15,15,15 everything is okay...
#include <TE3D.h>
#include <stdio.h>
#define OUTPUT_WIDTH 165
#define OUTPUT_HEIGHT 50
int main()
{
// Initialize the pipeline.
struct TE3D_Pipeline pipe = TE3D_InitializePipeline(OUTPUT_WIDTH, OUTPUT_HEIGHT);
// Change the vector-format, because we want to render points. The default vector format on initialization is TRIANGLES.
TE3D_Pipeline_ChangeVectorFormat(&pipe,TE3D_VECTORFORMAT_LINES);
// Load the model.
int newvectors, newindices;
struct List inputmodels;
inputmodels =LoadWavefrontFromFile("kinghearts.obj",TE3D_VECTORFORMAT_LINES, &newvectors, &newindices);
for (int i = 0; i < inputmodels.count; i++)
{
List_Add(&pipe.Models, List_At(&inputmodels, i));
}
// Adjust the vector and indices buffer, because they're now insufficient.
TE3D_Pipeline_ResizeVectorOutputBuffer(&pipe, newvectors);
TE3D_Pipeline_ResizeVectorIndexOutputBuffer(&pipe, newindices);
for (int i = 0; i < 100; i++)
{
// Set the stretch matrix. This improves the vision of the rendered scene,because the letters in the terminal are taller than wide.
pipe.Transformation = TE3D_Transformation4x4f_Scale(1, 0.5f, 1);
// Set the ortho-transformation.
TE3D_Pipeline_AppendTransformation(&pipe,TE3D_Transformation4x4f_OrthogonalProjection(TE3D_Vector3f_N(1,1,1),TE3D_Vector3f_N(0,1,0)));
// Add translation.
TE3D_Pipeline_AppendTransformation(&pipe,TE3D_Transformation4x4f_Translation(120, 80, 0));
// Rotate the model.
TE3D_Pipeline_AppendTransformation(&pipe,TE3D_Transformation4x4f_RotateY(i * 0.05));
// Scale up.
TE3D_Pipeline_AppendTransformation(&pipe,TE3D_Transformation4x4f_Scale(20, 20, 20));
// Render.
TE3D_Pipeline_Render(&pipe);
}
// Release inputmodels from the Wavefront file.
List_Release(&inputmodels);
// Release the pipeline.
TE3D_ReleasePipeline(&pipe);
}
This includes compatability to windows, audio output from tty (alsa, pulse?) and maybe mac support.
Maybe write some unit tests.
Possible approaches:
This includes:
Add material template library support for the obj files.
Maybe no textures, but the simple material diffuse color is sufficient.
The README needs some more serious text. A HACKME should be provided.
How about some interactive test that allows rotating the camera interactively via keyboard?
Check code for code style violations.
Or make a new one...
Implement ncurses support if ncurses is installed. Else fallback to normal.
This would also work with windows using cygwin.
We can do some very fancy things with this tool.
Some Ideas:
Maybe apply some of these rules automatically with the tool? Would need some rewriting. Or maybe suggest changes to programmer.
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.