Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science I 3D Classwork / Homework: plan and implement your own 3D example.

Similar presentations


Presentation on theme: "Computer Science I 3D Classwork / Homework: plan and implement your own 3D example."— Presentation transcript:

1 Computer Science I 3D Classwork / Homework: plan and implement your own 3D example

2 Processing renderers How Processing interprets information to draw in the display window. Display window specified using horizontal and vertical values Default: use Java libraries size(hs,vs); OpenGL libraries: often faster, extra capabilities size(hs,vs,P2D); or size(hs,vs,P3D);

3 3D Note: rect, ellipse, triangle, beginShape, etc. still draw flat shapes Plus 2 new primitives: box(), sphere() and custom shapes. Note: the sphere produces a faceted polyhedron. You may choose to use (do) noStroke();

4 3D coordinates Horizontal x, vertical y, and z coming out of the display Can translate in 3 dimensions Additional rotations: – rotateY, rotateX, rotateZ

5 Projection Turns a 3D scene into a 2D display – What type of projection? – Where is the camera (eye)? – Where is the light? Hidden line (hidden surface) calculation

6 More on 3D Can change Lighting Perspective Camera (eye)

7 Classwork Experiment! – Look up examples – Vary and make your own Reconvene to show example

8 Tilting board Objective: player uses arrow keys and tilts board but still tries to keep ball on board. The ball accelerates. If the ball falls off, the ball falls straight down. Note: can be improved. Did not use all variables.

9 Methods setup, draw, keyPressed moveBall, nice Demonstrate program. Show coding.

10 Classwork/Homework Experiment. More examples next class. Start designing and planning your 3D project now. – Use of classes encouraged.


Download ppt "Computer Science I 3D Classwork / Homework: plan and implement your own 3D example."

Similar presentations


Ads by Google