This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cohen–Sutherland Algorithm | |
bool clip(point &A, point &B, point Pmin, point Pmax) { | |
while (true) { | |
unsigned int C1 = 0; | |
if (A.x < Pmin.x) C1 += 1; | |
if (A.x > Pmax.x) C1 += 2; | |
if (A.y < Pmin.y) C1 += 4; | |
if (A.y > Pmax.y) C1 += 8; | |
unsigned int C2 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool clip(point &A, point &B, point Pmin, point Pmax) { | |
/* 1 */ | |
if (A.x > B.x) std::swap(A, B); | |
/* 2 */ | |
int C1 = 0; | |
if (A.x < Pmin.x) C1 += 1; | |
if (A.x > Pmax.x) C1 += 2; | |
if (A.y < Pmin.y) C1 += 4; | |
if (A.y > Pmax.y) C1 += 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define INFINITY float::MaxValue | |
polygon^ Pclip (polygon^ P, point Pmin, point Pmax) { | |
polygon^ P1 = gcnew polygon(0); | |
point A = P[P->Count - 1]; | |
int k = 0; | |
while (k < P->Count) { | |
point B = P[k]; | |
float t1out, t2in, t2out, | |
xin, xout, txin, txout, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Clip1Left(point &A, point &B, point Pmin, point Pmax) | |
{ | |
A.y = B.y - (B.x - Pmin.x) * (B.y - A.y) / (B.x - A.x); | |
A.x = Pmin.x; | |
} | |
void Clip1Top(point &A, point &B, point Pmin, point Pmax) | |
{ | |
A.x = B.x - (B.y - Pmax.y) * (B.x - A.x) / (B.y - A.y); | |
A.y = Pmax.y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ExtCode(point A, point Pmin, point Pmax) { | |
int C = 0; | |
if (A.x < Pmin.x) { | |
C += 1; | |
if (A.y < Pmin.y) C += 20; | |
if (A.y > Pmax.y) C += 24; | |
return C; | |
} | |
if (A.x > Pmax.x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:wheezy | |
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ | |
apt-get update && \ | |
apt-get install -y nasm gcc-multilib && \ | |
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "stdafx.h" | |
#include "Transform.h" | |
#include <math.h> | |
std::vector<mat> matrices(0); | |
mat L; | |
mat3D T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define HEIGHT this->ClientRectangle.Height | |
#define WIDTH this->ClientRectangle.Width | |
namespace test3v11 { | |
using namespace System; | |
using namespace System::ComponentModel; | |
using namespace System::Collections; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
point getInnerPoint(polygon^ P) { | |
// the following variables have a strict order: y_s < y_ss | |
float y_s = float::MaxValue, | |
y_ss = float::MaxValue; | |
// find two different min values | |
for (int i = 0; i < P->Count; i++) { | |
if (P[i].y < y_s) { | |
y_ss = y_s; | |
y_s = P[i].y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failed StepArgumentException with 'requirement failed: No keystore provided' | |
########################### MANIFEST ################################ | |
version: "1.1" | |
header: {} | |
launch: | |
steps: | |
provisionMicroUbuntuAmazon: | |
action: provisionVms |
OlderNewer