Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xinyue Zhu #11

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
12ef7e3
mouse and half section
Zhuxinyue909 Oct 9, 2015
a46855b
shading
Zhuxinyue909 Oct 10, 2015
4899499
Tesselation
Zhuxinyue909 Oct 11, 2015
5861bbf
try
Zhuxinyue909 Oct 12, 2015
105858a
Update README.md
Zhuxinyue909 Oct 12, 2015
d7155e3
Update README.md
Zhuxinyue909 Oct 12, 2015
a12003f
Update README.md
Zhuxinyue909 Oct 12, 2015
5d4a998
Update README.md
Zhuxinyue909 Oct 12, 2015
45abde5
Update README.md
Zhuxinyue909 Oct 12, 2015
c9e3595
Update README.md
Zhuxinyue909 Oct 12, 2015
e34242c
Update README.md
Zhuxinyue909 Oct 12, 2015
e179d24
Update README.md
Zhuxinyue909 Oct 12, 2015
120f982
Update README.md
Zhuxinyue909 Oct 12, 2015
9bb784d
Update README.md
Zhuxinyue909 Oct 12, 2015
baa2961
Update README.md
Zhuxinyue909 Oct 12, 2015
61d369a
Update README.md
Zhuxinyue909 Oct 12, 2015
98dec60
Update README.md
Zhuxinyue909 Oct 12, 2015
f5280a4
Update README.md
Zhuxinyue909 Oct 12, 2015
f309242
analyse
Zhuxinyue909 Oct 12, 2015
4203a4f
Update README.md
Zhuxinyue909 Oct 12, 2015
bdc6625
Update README.md
Zhuxinyue909 Oct 12, 2015
c66fcd1
cant push why
Zhuxinyue909 Oct 12, 2015
8e46cdb
Merge branch 'master' of https://github.com/Zhuxinyue909/Project4-CUD…
Zhuxinyue909 Oct 12, 2015
ea4a71f
Update README.md
Zhuxinyue909 Oct 12, 2015
28790b0
Update README.md
Zhuxinyue909 Oct 12, 2015
2b6531e
Update README.md
Zhuxinyue909 Oct 12, 2015
953563c
Update README.md
Zhuxinyue909 Oct 12, 2015
c6b05f4
readme
Zhuxinyue909 Oct 12, 2015
40bc0b9
Merge branch 'master' of https://github.com/Zhuxinyue909/Project4-CUD…
Zhuxinyue909 Oct 12, 2015
f649dce
Update README.md
Zhuxinyue909 Oct 12, 2015
824e63c
avi
Zhuxinyue909 Oct 12, 2015
4d1b8db
Merge branch 'master' of https://github.com/Zhuxinyue909/Project4-CUD…
Zhuxinyue909 Oct 12, 2015
819c1ae
Update README.md
Zhuxinyue909 Oct 12, 2015
ea7c31d
Update README.md
Zhuxinyue909 Oct 12, 2015
4eb5c27
Update README.md
Zhuxinyue909 Oct 12, 2015
ca08ebc
Update README.md
Zhuxinyue909 Oct 12, 2015
58902cc
Update README.md
Zhuxinyue909 Oct 12, 2015
24606d1
Update README.md
Zhuxinyue909 Oct 12, 2015
606a30b
Update README.md
Zhuxinyue909 Oct 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 1.avi
Binary file not shown.
Binary file added 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.avi
Binary file not shown.
Binary file added 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 3.avi
Binary file not shown.
Binary file added 4.avi
Binary file not shown.
Binary file added 5.avi
Binary file not shown.
355 changes: 19 additions & 336 deletions README.md

Large diffs are not rendered by default.

Binary file added p1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pipe_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
451 changes: 266 additions & 185 deletions src/main.cpp

Large diffs are not rendered by default.

820 changes: 730 additions & 90 deletions src/rasterize.cu

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/rasterize.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
void rasterizeInit(int width, int height);
void rasterizeSetBuffers(
int bufIdxSize, int *bufIdx,
int vertCount, float *bufPos, float *bufNor, float *bufCol);
void rasterize(uchar4 *pbo);
int vertCount, float *bufPos, float *bufNor, float *bufCol,bool resellation);
void rasterize(uchar4 *pbo, float x,float y,float u,float r);
void rasterizeFree();
5 changes: 4 additions & 1 deletion src/rasterizeTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ __host__ __device__ static
float calculateSignedArea(const glm::vec3 tri[3]) {
return 0.5 * ((tri[2].x - tri[0].x) * (tri[1].y - tri[0].y) - (tri[1].x - tri[0].x) * (tri[2].y - tri[0].y));
}

//1)if its points are collinear: 0
//2)if the points are in a counterclockwise direction:positive;clockwise: negative
//3)get the are
// CHECKITOUT
/**
* Helper function for calculating barycentric coordinates.
Expand All @@ -68,6 +70,7 @@ float calculateBarycentricCoordinateValue(glm::vec2 a, glm::vec2 b, glm::vec2 c,
// CHECKITOUT
/**
* Calculate barycentric coordinates.
* give a point r in triangle r=tri[0]*alpha+tri[1]*beta+tri[2]*gamma, alpha+ beta+ gamma=1
*/
__host__ __device__ static
glm::vec3 calculateBarycentricCoordinate(const glm::vec3 tri[3], glm::vec2 point) {
Expand Down