Code Monkey home page Code Monkey logo

graphics-project's Introduction

Graphics-project

——复旦大学2023年春《计算机图形学》课程项目
Computer Graphics Course (COMP130018.01, 2023 Spring) Project of Fudan University.
A copy of MIT 6.837, including Curves-surfaces(assn1) and Ray-casting-tracing(assn4, assn5).

Project1--曲线和曲面造型技术

分支切换

git checkout Curves-surfaces

环境搭建(linux)

sudo apt-get install build-essential cmake
sudo apt-get install freeglut3-dev xorg-dev libxrandr-dev libsdl2-de

编译运行

mkdir build
cd build
cmake ..
make
cd ..
build/a1 ./swp/circles.swp

样例结果查看

chmod a+x sample_solution/athena/a1
sample_solution/athena/a1 swp/core.swp

Part1--曲线的绘制

测试:

build/a1 ./swp/core.swp

Part2--曲面的绘制

测试:

build/a1 ./swp/wineglass.swp
build/a1 ./swp/weird.swp

Expansion--曲面的闭合问题

测试:

build/a1 ./swp/weirder.swp

Project--2 光照模型与光线追踪

分支切换

git checkout Ray-casting-tracing

环境搭建(linux)

sudo apt-get install build-essential cmake
sudo apt-get install freeglut3-dev xorg-dev libxrandr-dev libsdl2-de

编译运行

mkdir build
cd build
cmake ..
make
cd ..
//结果图片将保存到`test_out`文件夹下
build/a2 -input data/scene01_plane.txt -output test_out/01.png -size 200 200

样例结果查看(结果图片将保存到sample_out文件夹下)

chmod u+x sample_solution/athena/a2
sample_solution/athena/a2 -input data/scene01_plane.txt -output sample_out/01.png -size 200 200
sample_solution/athena/a2 -input data/scene06_bunny_1k.txt -output sample_out/06.png -size 300 300 -bounces 4
sample_solution/athena/a2 -input data/scene07_arch.txt -output sample_out/07.png -size 300 300 -shadows -bounces 4

批量生成图片并测试

chmod +x generate_images.sh
./generate_images.sh
chmod +x test_cases.sh
./test_cases.sh

Part1--Phong光照模型

测试:

build/a2 -size 800 800 -input data/scene01_plane.txt  -output test_out/a01.png -normals test_out/a01n.png -depth 8 18 test_out/a01d.png

Part2--光线投射

测试:

build/a2 -size 800 800 -input data/scene01_plane.txt  -output test_out/b01.png -normals test_out/b01n.png -depth 8 18 test_out/b01d.png
build/a2 -size 800 800 -input data/scene02_cube.txt   -output test_out/a02.png -normals test_out/a02n.png -depth 8 18 test_out/a02d.png
build/a2 -size 800 800 -input data/scene03_sphere.txt -output test_out/a03.png -normals test_out/a03n.png -depth 8 18 test_out/a03d.png
build/a2 -size 800 800 -input data/scene04_axes.txt   -output test_out/a04.png -normals test_out/a04n.png -depth 8 18 test_out/a04d.png
build/a2 -size 800 800 -input data/scene05_bunny_200.txt -output test_out/a05.png -normals test_out/a05n.png -depth 0.8 1.0 test_out/a05d.png

Part3--光线追踪与阴影投射

build/a2 -size 800 800 -input data/scene02_cube.txt   -output test_out/b02.png -normals test_out/b02n.png -depth 8 18 test_out/b02d.png
build/a2 -size 800 800 -input data/scene05_bunny_200.txt -output test_out/b05.png -normals test_out/b05n.png -depth 0.8 1.0 test_out/b05d.png
build/a2 -size 800 800 -input data/scene06_bunny_1k.txt -bounces 4 -output test_out/a06.png -normals test_out/a06n.png -depth 8 18 test_out/a06d.png
build/a2 -size 800 800 -input data/scene07_arch.txt -bounces 4 -shadows -output test_out/a07.png -normals test_out/a07n.png -depth 8 18 test_out/a07d.png

Expansion-- 抗锯齿的问题

测试:

build/a2 -size 200 200 -input data/scene01_plane.txt  -output test_out/c01.png -normals test_out/c01n.png -depth 8 18 test_out/c01d.png -jitter -filter

——具体内容详见各分支的README中的实验报告部分

graphics-project's People

Contributors

jeekzhang avatar ecolisquare 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.