1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Project P3: CSG Lecture 08, File P3.ppt Due Feb 14 Individual.

Slides:



Advertisements
Similar presentations
Nick Feamster Research: Network security and operations –Helping network operators run the network better –Helping users help themselves Lab meetings:
Advertisements

Shauvik Roy Choudhary, Alex Orso Georgia Institute of Tech nology.
For(int i = 1; i
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.

MiniDraw Testing COMP 102 # T1
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Programming Project 2 SORTING Lecture 05, file P2 Due January.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Programming Project 1 Truth Table Lecture 03, file P1 Due January.
Templated Functions. Overloading vs Templating  Overloaded functions allow multiple functions with the same name.
SORTING AND ASYMPTOTIC COMPLEXITY Lecture 12 CS2110 – Spring 2014 File searchSortAlgorithms.zip on course website (lecture notes for lectures 12, 13) contains.
Case study 1: Calculate the approximation of Pi
Lecture # 21 Chapter 6 Uptill 6.4. Type System A type system is a collection of rules for assigning type expressions to the various parts of the program.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
CSE 115 Week 13 April , Announcements April 7 – Exam 9 April 7 – Exam 9 April 10 – Last day to turn in Lab 7 for any credit, last day to turn.
C language issues CSC 172 SPRING 2002 EXTRA LECTURE.
1 Session-13 CSIT 121 Spring 2006 Test-1 is on March 9 th ; Demo-5 due date extended to March 7 Test-1 is on March 9 th ; Demo-5 due date extended to.
1 Chapter 5 Concurrency. 2 Concurrency 3 4 Mutual Exclusion: Hardware Support Test and Set Instruction boolean testset (int *i) { if (*i == 0) { *i.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Scientific Visualization  CS4550 :
ITEC 320 Lecture 16 Packages (1). Review Questions? –HW –Exam Nested records –Benefits –Downsides.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Project 1  Problem  Work plan  Guidelines  Deliverables  Report.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 06: COMPLEXITY Sections 2.2 and 2.3 Jarek Rossignac CS1050:
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
Creating With Code.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01a: Overview of the course Jarek Rossignac CS1050: Understanding.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
1 Georgia Tech, IIC MAGIC Lab Rossignac CS3451, Graphics  Objectives  Instructor  GVC areas  STL  Modules 
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 09: SEQUENCES Section 3.2 Jarek Rossignac CS1050: Understanding.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Project P9 Graphs Jarek Rossignac CS1050: Understanding and Constructing.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
1 Georgia Tech, IIC, GVU, 2007 MAGIC Lab Rossignac Perspective & scan-conversion  How to draw perspective images.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Bezier example  Interaction  Animation  Tracking  Menus  Debugging.
ITEC 320 Lecture 9 Nested records / Packages. Review Project ?’s Records Exam 1 next Friday.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Graphic pipeline  Scan-conversion algorithm (high level)  Pixels.
Learning Guidance Plan Storytelling: Magic tree house #1 8-time/1book 15-min class.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 17a: ACTIVE ZONES of CSG primitives Jarek Rossignac CS1050:
A: A: double “4” A: “34” 4.
Digital Media Lecture 0: It’s all just bits! Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Computer Graphics Lecture 26 Fasih ur Rehman. Last Class Shading Phong Reflection Model.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 05: SORTING Section 2.1 Jarek Rossignac CS1050: Understanding.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 04: SETS AND FUNCTIONS 1.6, 1.7, 1.8 Jarek Rossignac CS1050:
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 09a: PROOF STRATEGIES Section 3.1 Jarek Rossignac CS1050:
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Shadows & occlusion  Shadow - occlusion duality  Floor shadows.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
亚洲的位置和范围 吉林省白城市洮北区教师进修学校 郑春艳. Q 宠宝贝神奇之旅 —— 亚洲 Q 宠快递 你在网上拍的一套物理实验器材到了。 Q 宠宝贝打电话给你: 你好,我是快递员,有你的邮件,你的收货地址上面 写的是学校地址,现在学校放假了,能把你家的具体 位置告诉我吗? 请向快递员描述自己家的详细位置!
CSE 373 Spring 2016 HW 3 BST: Keyword Search due Friday April 22.
Agenda Warmup Finish 2.4 Assignments
Haotian Tang Benjie Miao
Alg2_1c Extra Material for Alg2_1
C Basics.
Geometry of Interaction
Review Operation Bingo
Theory of Computation Lecture 6: Primitive Recursive Functions I
مبررات إدخال الحاسوب في رياض الأطفال
Lecture 9 Greedy Strategy
Final practice CS1050: Understanding and Constructing Proofs
21twelveinteractive.com/ twitter.com/21twelveI/ facebook.com/21twelveinteractive/ linkedin.com/company/21twelve-interactive/ pinterest.com/21twelveinteractive/
TEALS Minecraft Project
Template Functions Lecture 9 Fri, Feb 9, 2007.

EECE.2160 ECE Application Programming
Theory of Computation Lecture 5: Programs and Computable Functions III
Java: Variables, Input and Arrays
TCSS 360, Spring 2005 Lecture Notes
Sigma and Pi Bonding.
Presentation transcript:

1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Project P3: CSG Lecture 08, File P3.ppt Due Feb 14 Individual (Code and PPP) Jarek Rossignac CS1050: Understanding and Constructing Proofs Spring 2006

2 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Objectives Implement a 2D design system supporting –Disk primitives –CSG trees with Boolean operators –Interactive placement of primitives –Rendering of the resulting image Extensions for extra credit –Interactive editing of CSG tree

3 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Disk class and point-in-disk test class Disk { // class for disk primitive int x, y, r; Disk (int px, int py, int pr) {x=px; y=py; r=pr;}; void move (int px, int py) {x=px; y=py;}; boolean in (int pi, int pj) { boolean isIn=false; if (sq(pi-x)+sq(pj-y)<sq(r)) {isIn=true;}; return(isIn); }; void write () {println("x="+x+", y="+y+", r="+r);}; void show () {ellipse(x,y,2*r,2*r);;}; };

4 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Setting up 3 primitives Disk[] P = new Disk[np]; // array of primitives void setup() { … P[0]=new Disk(150,150,100); // make primitives with Cx, Cy, radius P[1]=new Disk(250,150,100); P[2]=new Disk(200,250,100);

5 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Editing the primitives int pp=0; // currently selected primitive for moving it void keyPressed() { switch(key) { case 'p': for(int k=0; k<np; k++) {print("P["+k+"] : "); P[k].write();}; break; case '.': pp=(pp+1) % np; break; // select next primitive case ',': pp=(pp-1) % np; break; case '>': P[pp].r += 10; break; // incrase the radius of selected primitive case '<': P[pp].r -= 10; break; … }; void mousePressed() {P[pp].move(mouseX,mouseY);}; // move center of selected primitive

6 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Draw calls pmc void draw() { // paints pixel (i,j) based on its classification for(int j=0; j<height; j++) { // j defines row and goes DOWN for (int i=0; i<width; i++) { // I defines the pixel in row if (pmc(0,i,j)) { set(i,j,green);} else set(i,j,red);};}; // set color depending on pmc … for(int k=0; k<np; k++) {P[k].show();}; // draws circles }

7 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Point-in-CSG test boolean pmc (int n, int pi, int pj) { // returns true if pixel (pi,pj) is in region of node n boolean res=false; switch(o[n]) { case 'p': res=P[L[n]].in(pi,pj); break; // if n is a primitive, call its "in" method // *** edit to improve performance by avoiding redundant recursive calls case '-': res= pmc(L[n],pi,pj) && !pmc(R[n],pi,pj); break; // if difference, combine result of recursive call // *** add here the lines for union, intersection, xor }; return(res); };

8 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Assigned implementation Add the code for the other operations Modify these statements to avoid redundant recursions –if P in A, then P in A–B, hence, no need to test against B Manually edit the code defining the CSG tree and primitive lists to produce a Mikey Mouse face –Ears, slit eyes, smiley mouth. Front or profile Add key action to change selected CSG node –(initially 0, root) – * P means go to parent (or stay if root) – * L means go toleft child (or stay if leaf) – * R means go to righ child (or stay if leaf) Key actions to edit the operator at the selected CSG node Key action to change the ID of the primitive at the currently selected leaf node to be the ID of the currently selected primitive

9 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Extra credit Extra credit if develop data-structure and code to support: Keys to expand primitive nodes to Boolean nodes (press key for desired operator): +5% Keys to collapse Boolean nodes to primitive: +5% Add code and key-actions to save and load the CSG and Primitives: +10%

10 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Deliverables The usual on PPP with applet, code with COMMENTS, Include the definition and image of your Mikey Mouse Clearly indicate which extra credit parts you have implemented