Code Monkey home page Code Monkey logo

the-color-of-tea's Introduction

The Color of Tea

This program use OpenGL to create an 3D virtual scene, approximated a picture of still life photography.

target image Target image (The color of tea)

Methodology

Model

All models created by 3ds Max.

Shading

The shading approach for the static objects in the scene is classic Phong-shading model. By modify the coefficient of ambient, diffuse and specular reflection for different object, the program can simulate different material.

As for the rendering for transparent object (glass), this program use a Fresnel value to control the alpha value so the glass will be more transparent when the viewing vecotr is more closer to the normal of the surface, and the glass will show its color when the viewing angle is big.

Texture mapping

There are two different approach of texture mapping in this program. For the object model has UV coordinate, the program will directly import the texture coordinate. For those doesn't, the program will generate the texture coordinate by apply a texture mapping on the model. In this particular scene, the tea cup model doesn't have UV coordinate and the program applied a cylindrical texture mapping on it.

Result

screenshot 1 Screenshot of the view from camera #1

Control

  • 1 - switch to the camera #1
  • 2 - switch to the camera #2
  • 3 - switch to the camera #3
  • a - start animating (rotate the camera #1)
  • s - stop animating
  • r - reset camera #1
  • esc or q - quit the program

Requirement

OpenGL 3.0

GLEW

GLFW

GLM (math library)

SOIL (image handle library)

TODO

  • Shadow mapping
  • Reflection
  • Advanced shading model (PBR)

the-color-of-tea's People

Contributors

cjt-jackton avatar

Stargazers

 avatar

Watchers

 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.