World Coordinate System: You Choose!

Slides:



Advertisements
Similar presentations
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Advertisements

1. 2 Viewing window: You can watch the movie that is emerging by using the controls underneath. These work like a standard video player. Timeline: When.
Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Cosc 5/4730 Blackberry Drawing. Screen size With Blackberry devices, they have a known screen size in pixels. If you are programming for specific device.
Java ThreadsGraphics Programming Graphics Programming: Windows, Viewports & Clipping.
Animating Web Graphics Using Adobe Edge. 1. Setting up your project Create a new folder on your desktop Call it [YOURNAME]infographic INSIDE THAT FOLDER,
Image Maps and Graphics Internet Basics and Far Beyond! Mrs. Wilson.
Introducing Microsoft PowerPoint 2010 John Matthews (ITS)
How to prepare a PowerPoint presentation
Informationsteknologi Monday, November 12, 2007Computer Graphics - Class 71 Today’s class Viewing transformation Menus Mandelbrot set and pixel drawing.
May 11, 1998CS102-02Lecture 7-1 More Graphics in Java CS Lecture 7-1 A picture's worth a thousand words.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Better Interactive Programs Ed Angel Professor of Computer Science, Electrical and Computer.
Elision Based Text Zooming Sam Davis. 2 Basic Idea Add zoom control to web browser Zoom out to show more of document Focused on text, not images Instead.
Picking. What is picking? Selecting an object on the screen What does this require? –Get Mouse Location –Compute what objects are rendered at the position.
Creating a Simple Flyer. Click on Flyers! Scroll down and select Sale Flyers Select For Sale Flyer you like. Double click it.
CS 376 Introduction to Computer Graphics 02 / 12 / 2007 Instructor: Michael Eckmann.
PowerPoint Tutorial. Basic Vocabulary ► Slide - Presentation - Slide layout – ► ► ► a single page in PowerPoint all the slides for a speech all the slides.
PowerPoint Tutorial Your Logo Here It’s easier than you think!
Impress with Prezi! Tech Tip #7 Brought to You by: Tiffany Zaleski MEDT Spring 2010 All photos of Prezis from
Shadows via Projection Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, November 5, 2003.
Computing & Information Sciences Kansas State University Lecture 20 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 21 of 42 William H. Hsu.
COMP261 Lecture 3 Graphs 2 of 3. Locations (The Hardest Part of A1?) Three representations of a location/place/point latitude/longitude –what you need.
A guide to creating a power point display Essentials Ctl M =New Slide: a new slide can be inserted. It is placed after the slide that you are viewing.
Java Graphics. Review 3 kinds of elements in components API? Layout managers Events Extend vs. Implement.
AUSTRALIA INDONESIA PARTNERSHIP FOR EMERGING INFECTIOUS DISEASES.
Sketchup For 3D Design. Examples.
Photoshop CC Workspace
1 Graphics CSCI 343, Fall 2015 Lecture 6 Viewing, Animation, User Interface.
Java Dynamic Graphics.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
Map Manipulation 2 In Explore mode Dsauce - 12/07/2007.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Rendering Pipeline and Primitive Rasterization.
Zoom and Pan1 Sacramento City College Engineering Design Technology.
Animating Objects in PowerPoint XP/2003 Using Motion Paths and Custom Animations to add interest to your classroom presentations.
National Atlas Instructions 1 January 2013 Version.
More Graphics. Hit Testing Mouse clicked here What did I click on?
ENGINEERING 1D04 Tutorial 4. What are we doing today? Focus Functions Scope of Variables Returning Values Objects Graphics library Aliasing Events Mouse.
PowerPoint Tutorial.
COMP261 Lecture 4 Graphs 3 of 3.
Introduction to Illustrator
11. Viewing Transformations
CSE / ENGR 142 Programming I
Flash Interface, Commands and Functions
Adobe Flash Professional CS5 – Illustrated
Digimap Ordnance Survey - Roam
Milestone 2 Overview.
Better Interactive Programs
Presenting Prezi Michael Pelitera
Autodesk Inventor 2008 Tutorial One Machine Part Alva Academy
Using PowerPoint to Present Research Results
Word Lesson 6 Working with Graphics
The iD Editor Beginners Guide.
Adding Shapes and Text to Pictures on PowerPoint
Creating a PowerPoint Presentation
Viewing Transformations
Computer Graphics Lecture 20
Drawing Issues Drawing Coordinate Systems Drawing with Pixels CS-321
Power Point Tutor.
Chapter Lessons Use the Macromedia Flash drawing tools
Project 1: Into Space! CG Concepts Needed
Google Calendar Appointments
Design Studies “Show Off” Project
Getting Started with Milestone 2
Views in Word 2010.
2D Graphics Lecture 4 Fri, Aug 31, 2007.
InDesign Basics.
Introduction to PowerPoint
Milestone 2 Overview.
Add some WordArt to your cover slide
Themes, Styles, & Graphics
Presentation transcript:

World Coordinate System: You Choose! E.g., use km from Prime Meridian & Equator set_visible_world (-2000, 4010, -1950, 4025) world: (-1950,4034.7) world: (-2000,4000.3) Maintains aspect ratio

Screen (Pixel) Coordinates: Fixed world: (-1950,4034.7) world: (-2000,4000.3) screen (900, 619)

Panning & Zooming: EasyGL Transforms world: (-1960,4026.5) easygl changes the mapping from world  screen pixels Calls your drawscreen () Only a part of your picture shows up on screen world: (-1990,4007.8)

Panning & Zooming: EasyGL Transforms You can draw everything But will only see the part that maps to the screen world: (-1960,4026.5) world: (-1990,4007.8)

Pan & Zoom (Transform) Implications Your drawscreen() callback can always draw the whole map (world) Only proper part will show up on screen Costs some CPU time to draw objects that aren’t on screen, but less than you might expect (pre-clipped) Don’t call set_visible_world() in drawscreen() Would disable panning and zooming

Screen Coordinates for Fixed Overlays What if I want to draw a scale in the upper-left? Don’t want it to move / resize with pan & zoom set_coordinate_system (GL_SCREEN); // All drawing in screen (pixel) coords until you call set_coordinate_system (GL_WORLD) 0 1 km

Level of Detail Zoomed way in  can show small details (street names, small streets, …) Zoomed way out  draw every detail:

Level of Detail Utilities setfont (10); // 10 point font  10/72 inch high t_point center (-1970, 4020); drawtext (center, “Awesome street”); float streetLength = 0.2; // 200 m long. drawtext (center, “Awesome street”, streetLen, streetLen); Fonts are in screen coordinates, not world coordinates. What if this text is much longer than the street? Awesome Street My Street Electric Avenue AYour Street Sesame Street E. Street Easy Street Text won’t be drawn if it is wider or higher than these numbers, in world coordinates drawtext (t_point cen, string text, bound_x = FLT_MAX, bound_y=FLT_MAX) Last two parameters optional: default to huge boundary (always draw)

Level of Detail Utilities t_bound_box get_visible_world(); Returns a rectangle  the world coordinates of the screen edges Use to decide if you’re zoomed in or not bool LOD_screen_area_test(t_bound_box test, float screen_area_threshold); Returns true if the (world coordinate) test rectangle will fill more than screen_area_threshold pixels

Hit Testing Mouse clicked here What did I click on?

Hit Testing easygl does not know what you drew “Immediate mode” graphics Draws the pixels for a line, etc. Does not remember the line! Hit testing: you must code act_on_button_press (x, y, button_info) What is closest to that (x,y)? Code demo … Hit testing & highlighting

Constant Redraws  Screen Can Flash clearscreen(), then draw Can see flashes as graphics appear & disappear

Single vs. Double Buffering Single Buffer (default) set_drawing_buffer(OFF_SCREEN) drawline() … drawline() … copy_off_screen_buffer_to_screen() Last line in your drawscreen() callback No redraw flashes  movement looks smoother

Friday: Guest Lecture Leaders from 3 major tech companies in Southern Ontario Shawn Malhotra, Director, Intel Deshanand Singh, Senior Manager, Amazon Paul Leventis, Technical lead & manager, Google Topics Project management & communication at each company What each looks for in engineers