Giter Site home page Giter Site logo

andy-thomason / octet Goto Github PK

View Code? Open in Web Editor NEW
12.0 6.0 68.0 7.82 MB

A single module, header only C++ framework for learning OpenGL

Makefile 0.02% C 2.87% HTML 67.19% CSS 0.22% JavaScript 0.37% C++ 29.14% CMake 0.06% Lua 0.01% Python 0.03% Batchfile 0.01% GLSL 0.07% C# 0.01% Objective-C 0.01%

octet's Introduction

octet

Octet is a framework for teaching OpenGL and the rudiments of game programming such as Geometry construction, Shaders, Matrices, Rigid body Physics and Fluid dynamics.

It has a number of examples in the src/examples directory.

To use with visual studio, fork this repository into your own account and then "Clone Into Desktop" using the GitHub tool and open one of the .sln files in src/examples.

There is a python script for generating your own projects from a template.

From the octet directory run:

packaging\make_example.py my_example

To create your own project in src/examples

Examples should also work with Xcode, although testing is a lot less thorough. If it does not work, send me a pull request with fixes, please...

Octet is a bit unusual in that it does not use external libraries such as libjpeg or zlib. These are implemented in source form in the framework so that you can understand the code. The source of most academic libraries is almost unreadble, so we aim to help your understanding of coding codecs such as GIF, JPEG, ZIP and so on.

octet's People

Contributors

andy-thomason avatar parmandorc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

octet's Issues

Translating after rotating gives wrong orientation to objects.

The following code draws the axis twice - the second time after rotating 30 degrees on the Y axis, and then translating along the (local) X axis.

mat4t mat;
mat.loadIdentity();
app_scene->add_shape(mat, new mesh_box(vec3(5.0f, 0.1f, 0.1f)), red, false);
app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 5.0f, 0.1f)), green, false);
app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 0.1f, 5.0f)), blue, false);

mat.rotateY(30);
mat.translate(1, 0, 0);
app_scene->add_shape(mat, new mesh_box(vec3(2.0f, 0.1f, 0.1f)), red, false);
app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 2.0f, 0.1f)), green, false);
app_scene->add_shape(mat, new mesh_box(vec3(0.1f, 0.1f, 2.0f)), blue, false);

It looks like this:
wrong

When it should look like this:
right

The position of the object is correct, but its orientation is as if the rotation had been in the opposite direction.

bug in mesh::calc_aabb

Hi Andy,
Just spotted a bug in mesh::calc_aabb,
vmax = max(pos, vmin);
should be:
vmax = max(pos, vmax);
Cheers!
Daniel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.