Giter Site home page Giter Site logo

general-linear-camera-model's Introduction

General-Linear-Camera-model

CS 535 Assignment 1 - This project implement a General Linear Camera (GLC) model with freeglut

Object

This program defined hitable virtual class which derives two classes, sphere and triangleMesh. This two classes are defined in sphere.h and triangleMesh.h.

Ray-object intersection

The sphere class and the triangleMesh class have different implementation of the ray-object intersection method which is written in hit() method. You can check them in the header file mentioned above. This part referred to these resources:

GLC Definition

The GLC is defined in GLCcamera.h as a class. It is defined by 6 points in 2 planes. It also has functions to set the rotation matrix of the camera.

GLC Rendering

The result for the GLC is saved as a .jpg image which is then read as a texture to render on the screen. You can check the LoadTexture() and WriteTexture() in main.cpp for more details.

GUI

  • You can press and hold the mouse left button and move the mouse to rotate the camera, just like in fps games. If you feel strange with the X-axis or Y-axis movement, you can also right click the mouse and choose “reverse X-axis” or “reverse Y-axis”
  • You can right click the mouse to choose camera modes from “pinhole” “orthographic” and “XSlit” (XSlit is as defined in the GLC paper).

Extra

  • Besides of using triangle meshes, this program generates sphere objects.
  • This program uses ray-casting to imitate the diffuse light, which can also generate shadows.

general-linear-camera-model's People

Contributors

yuanpeizhao avatar

Stargazers

JayLee avatar  avatar

Watchers

James Cloos avatar  avatar

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.