Giter Site home page Giter Site logo

computer-graphics's Introduction

  • Hi, I’m Sourland
  • I’m interested in a lot of engineering fields
  • I’m currently studying Electrical and Computer Engineering in Aristotle University of Thessaloniki
  • I’m looking to collaborate on anything...really
  • How to reach me [email protected]
  • Currently busy with AcubeSAT Project by SpaceDot
  • Lead Software Engineer of PeakSAT project by SpaceDot

computer-graphics's People

Contributors

sourland avatar

Stargazers

 avatar

Watchers

 avatar

computer-graphics's Issues

Create a linear interpolation function

Name: value = interpolate_color(x1, x2, x, C1, C2)

Input:

  • x1, x2 -> 2D triangle vertices coordinates
  • x ->the point that interpolation is applied to
  • C1, C2 -> 3D components of x1, x2 color values

Returns:

  • value ->The interpolation of C1, C2.

Create a triangle filling function

A function that fills triangles with colors
Name: Y = shade_triangle(img, verts2d, vcolors, shade_t = "flat")
Input:

  • img -> an NxMx3 array with existing triangles
  • verts2d -> a 3x2 array containing triangle vertices coordinates
  • vcolors -> a 3x3 array containing the rgb value of each vertice ([0,1] range)
  • shade_t -> the algorithm alternations ("Flat" or "Gouraud")

Returns:

  • Y -> a NxMx3 array containing (Ri, Gi, Bi) color components for every i point of a triangle, with the pre-existing triangles

  • Flat variation: Every Triangle gets one color: the vertices color mean

  • Gouraud variation: Every pixel of the triangle is colored using linear interpolation from the triangle's vertices

    1. Interpolation between vertices V1,V2 (Point A)
    2. Interpolation between vertices V1,V3 (Point B)
    3. Interpolation between points A,B (Point P - Final)
    4. Use scanline

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.