A Very Simple Approach for 3-D to 2-D Mapping

Similar documents
AVERYSIMPLEAPPROACHFOR3-DTO2-DMAPPING

Ones Assignment Method for Solving Traveling Salesman Problem

Chapter 3 Classification of FFT Processor Algorithms

Intro to Scientific Computing: Solutions

IMP: Superposer Integrated Morphometrics Package Superposition Tool

Pattern Recognition Systems Lab 1 Least Mean Squares

Creating Exact Bezier Representations of CST Shapes. David D. Marshall. California Polytechnic State University, San Luis Obispo, CA , USA

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0

EVALUATION OF TRIGONOMETRIC FUNCTIONS

Alpha Individual Solutions MAΘ National Convention 2013

Fast Fourier Transform (FFT) Algorithms

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Lecture 1: Introduction and Strassen s Algorithm

Parabolic Path to a Best Best-Fit Line:

top() Applications of Stacks

LU Decomposition Method

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Numerical Methods Lecture 6 - Curve Fitting Techniques

Reversible Realization of Quaternary Decoder, Multiplexer, and Demultiplexer Circuits

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Research Article Kinematics Analysis and Modeling of 6 Degree of Freedom Robotic Arm from DFROBOT on Labview

Python Programming: An Introduction to Computer Science

EE260: Digital Design, Spring /16/18. n Example: m 0 (=x 1 x 2 ) is adjacent to m 1 (=x 1 x 2 ) and m 2 (=x 1 x 2 ) but NOT m 3 (=x 1 x 2 )

Fuzzy Minimal Solution of Dual Fully Fuzzy Matrix Equations

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method

Solving Fuzzy Assignment Problem Using Fourier Elimination Method

The number n of subintervals times the length h of subintervals gives length of interval (b-a).

An Efficient Algorithm for Graph Bisection of Triangularizations

Assignment 5; Due Friday, February 10

BOOLEAN MATHEMATICS: GENERAL THEORY

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming

Accuracy Improvement in Camera Calibration

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Analysis of Algorithms

CS Polygon Scan Conversion. Slide 1

1.2 Binomial Coefficients and Subsets

INTERNATIONAL JOURNAL OF ADVANCED RESEARCH IN ENGINEERING AND TECHNOLOGY (IJARET) A NEW RADIX-4 FFT ALGORITHM

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS)

Improvement of the Orthogonal Code Convolution Capabilities Using FPGA Implementation

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

Efficient Hough transform on the FPGA using DSP slices and block RAMs

The isoperimetric problem on the hypercube

An Efficient Algorithm for Graph Bisection of Triangularizations

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Second-Order Domain Decomposition Method for Three-Dimensional Hyperbolic Problems

Data Structures and Algorithms. Analysis of Algorithms

Visualization of Gauss-Bonnet Theorem

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Neural Networks A Model of Boolean Functions

EE123 Digital Signal Processing

Chapter 18: Ray Optics Questions & Problems

A Note on Least-norm Solution of Global WireWarping

Consider the following population data for the state of California. Year Population

The following algorithms have been tested as a method of converting an I.F. from 16 to 512 MHz to 31 real 16 MHz USB channels:

AN OPTIMIZATION NETWORK FOR MATRIX INVERSION

Section 7.2: Direction Fields and Euler s Methods

ANN WHICH COVERS MLP AND RBF

How do we evaluate algorithms?

Lecture 18. Optimization in n dimensions

Math 10C Long Range Plans

Arithmetic Sequences

Project 2.5 Improved Euler Implementation

Redundancy Allocation for Series Parallel Systems with Multiple Constraints and Sensitivity Analysis

A RELATIONSHIP BETWEEN BOUNDS ON THE SUM OF SQUARES OF DEGREES OF A GRAPH

Extended Space Mapping with Bézier Patches and Volumes

3D Model Retrieval Method Based on Sample Prediction

On Infinite Groups that are Isomorphic to its Proper Infinite Subgroup. Jaymar Talledo Balihon. Abstract

APPLICATION NOTE PACE1750AE BUILT-IN FUNCTIONS

One advantage that SONAR has over any other music-sequencing product I ve worked

PLEASURE TEST SERIES (XI) - 04 By O.P. Gupta (For stuffs on Math, click at theopgupta.com)

The Magma Database file formats

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions:

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

Load balanced Parallel Prime Number Generator with Sieve of Eratosthenes on Cluster Computers *

Lecture 24: Bezier Curves and Surfaces. thou shalt be near unto me Genesis 45:10

Wavelet Transform. CSE 490 G Introduction to Data Compression Winter Wavelet Transformed Barbara (Enhanced) Wavelet Transformed Barbara (Actual)

COARSE ANGLE ROTATION MODE CORDIC BASED SINGLE PROCESSING ELEMENT QR-RLS PROCESSOR

CMPT 125 Assignment 2 Solutions

. Written in factored form it is easy to see that the roots are 2, 2, i,

South Slave Divisional Education Council. Math 10C

CHAPTER IV: GRAPH THEORY. Section 1: Introduction to Graphs

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

27 Refraction, Dispersion, Internal Reflection

n We have discussed classes in previous lectures n Here, we discuss design of classes n Library design considerations

FURTHER INTEGRATION TECHNIQUES (TRIG, LOG, EXP FUNCTIONS)

Mobile terminal 3D image reconstruction program development based on Android Lin Qinhua

Texture Mapping. Jian Huang. This set of slides references the ones used at Ohio State for instruction.

EE University of Minnesota. Midterm Exam #1. Prof. Matthew O'Keefe TA: Eric Seppanen. Department of Electrical and Computer Engineering

Analysis of Algorithms

Cubic Polynomial Curves with a Shape Parameter

A Polynomial Interval Shortest-Route Algorithm for Acyclic Network

The golden search method: Question 1

Integration: Reduction Formulas Any positive integer power of sin x can be integrated by using a reduction formula.

condition w i B i S maximum u i

Improved Random Graph Isomorphism

SD vs. SD + One of the most important uses of sample statistics is to estimate the corresponding population parameters.

Transcription:

A Very Simple Approach for -D to -D appig Sadipa Dey (1 Ajith Abraham ( Sugata Sayal ( Sadipa Dey (1 Ashi Software Private Limited INFINITY Tower II 10 th Floor Plot No. - 4. Block GP Salt Lake Electroics Complex Sector V Kolkata 700091 Ajith Abraham ( IITA Professorship Program School of Computer Sciece Yosei Uiversity 14 Shicho-dog Sudaemoo-ku Seoul 10-749 Republic of Korea Email: ajith.abraham@ieee.org Sugata Sayal ( School of Techology & Computer Sciece Tata Istitute of Fudametal Research Homi Bhabha Road umbai - 400005 INDIA email: sayal@tifr.res.i

Abstract ay times we eed to plot -D fuctios e.g. i may scietific experimets. To plot the -D fuctios o -D scree it requires some kid of mappig. Though OpeGL DirectX etc -D rederig libraries have made this job very simple still these libraries come with may complex pre-operatios that are simply ot iteded also to itegrate these libraries with ay kid of system is ofte a tough trial. This article presets a very simple method of mappig from -D to -D that is free from ay complex pre-operatio also it will work with ay graphics system where we have some primitive -D graphics fuctio. Also we discuss the iverse trasform ad how to do basic computer graphics trasformatios usig our coordiate mappig system. 1. Itroductio We have a fuctio f :R R ad our itetio is to draw the fuctio i - D plae. The fuctio z = f(x y is a -variable fuctio ad each tuple (x y f(x y R. Let s say we wat to graphically plot f oto computer scree usig a primitive graphics library (like Turbo C graphics which supports oly the basic putpixel (to draw a pixel i - D scree -like - D rederig fuctio but o - D rederig; i.e. our graphics library s putpixel s domai is R ad it s ot R. Hece i order to draw the fuctio f usig our graphics library we must desig a coordiate coversio system that will provide us with a fuctio that will take as iput -tuples (x y f(x y ad produce as output a - tuple ( x y that ca be directly passed to our graphics library to plot it oto the scree but with - D look & feel. As we discussed it s essetial that we have a simple coordiate mappig system that maps R to R ad still gives us a hypothetical feelig of drawig - D fuctios. It s very easy to fid such a map i.e. a fuctio h that maps from R to R i.e. h :R R ad i this paper we try to fid such a simple map.. Proposed approach We have a pictorial represetatio (Figure 1 of our - D to - D mappig system: Figure 1. Basic odel of a simple - D to - D mappig system But how the fuctio f should look like after mappig ad plottig? Here we simulate the rd coordiate (amely Z i our - D x-y plae. We perform the logical to physical coordiate trasform ad everythig by the map fuctio h which will basically tur out to be a matrix. The basic mappig techique is show i figure- which we are shortly goig to explai. (0 0 Figure.The basic coordiate mappig (w h If we have our Origi O at (xo yo scree coordiate we have

x' = xo + y - x.si( θ = yo - z + x.cos( θ i.e. we have our -D to -D trasformatio matrix: (1 Followig surfaces (figure- ad figure-4 are draw i Turbo C++ versio.0 (BGI graphics usig the above simple -D to -D mappig: si( θ cos( θ = 1 0 ( Agai we have shiftig (chage of origi by the matrix O = [xo yo] so that we have followig O + PD = P where deotes matrix multiplicatio ad + deotes matrix additio the -tuple PD = [x y z] the -tuple P = [x y] i.e. siθ cosθ [ xo yo] + [ x y z]. 1 0 = [ x' ] ( matrix matrix matrix matrix Figure. Sie fuctio draw i TurboC++ Ver.0 (BGI Graphics usig -D to -D mappig By default we keep the agle betwee X axis & Z axis = θ = π / 4 that oe ca chage if required but with the followig iequality strictly satisfied: 0 < θ < π /. Oe ca optioally use a compressio factor to cotrol the dimesio alog Z-axis by a compressio factor ρ z ad slightly modifyig the equatios: x' = xo + y - x.si( θ = yo - ρ z. z + x.cos( θ (4 Obviously 0.0 < ρ z < 1.0 By default we take ρ z =1. 0. Sample Output Surfaces draw usig the above mappig: Figure 4. Syc fuctio draw i TurboC++ Ver.0 (BGI Graphics usig the - D to - D mappig

4. Iverse Trasformatio - Obtaiig origial -D coordiate from the trasformed -D coordiate Here our trasformatio fuctio (matrix is: x' = xo + y - x.si( θ = yo - z + x.cos( θ (5 As we ca see it is impossible to re-covert ad obtai the origial set of coordiates amely (x y z because we have ukows ad equatios. So i order to be able to get the origial coordiates back we at least eed to store tuples as result of the trasformatio for istace (x y z (x y z the z-coordiate beig stored oly to get the iverse trasform of the form ( x y z (x y z ad the ( x y pair is used to plot the poit. So i order to get the iverse trasformatio we eed to solve the equatios for x y sice we already kow z we have -equatios ad ukow variables: y x.si( θ = x' xo x.cos( θ = - yo + z Solvig the above equatios we get x = ( - yo y = x' xo + ( + z.sec( θ - yo + z. ta( θ (6 (7 Put it i aother way our trasformatio matrix is a matrix si( θ cos( θ = 1 0 (8 Sice a o-square matrix o questio of existece of its iverse. So i order to be able to get the iverse trasform as well we eed a ivertible square matrix e.g. si( θ cos( θ 0 = 1 0 0 1 (9 with si( θ cos( θ 0 Det( det 1 0 0 X = 1 (10 si( θ cos( θ = 1. = cos( θ 1 0 Now 0 < θ < π / hece cos( θ 0 hece Det( 0 ad the iverse exists. si( θ cos( θ 0 [ xo yo 0] + [ x y z]. 1 0 0 = [ x' z] 1 1 matrix matrix matrix matrix (11 But we have Iv( Det( = ( 0 Adj( = Det( ad 0 cos( θ 0 Adj ( = si( θ 0 si( θ cos( θ (1 Hece 0 1 0 Iv ( = = sec( θ ta( θ 0 sec( θ ta( θ 1 Here cos( θ 0 (1 So the iverse trasform is:

si( θ 0 cos( θ 0 1 [ x y z]. 1 0 0 = [ x' z] [ xo yo 0] [ x y z] = [ x' xo yo z]. 0 sec( θ sec( θ 1 ta( θ ta( θ 0 0 1 [( - yo+ z.sec( θ x ' + (- yo+ z.ta( θ z] = xo (14 This exactly matches with our previous derivatio. 5. Rotatio ad affie trasformatios A poit i -D after beig mapped to -D scree followig the above mappig procedure may be required to be trasformed usig stadard computer graphics trasformatios (traslatio rotatio about a axis etc. But i order to udergo such a graphics trasformatio ad to show the poit back to the scree after the trasformatio it eeds to go through the followig steps i our previously-described coordiate mappig system: First obtai the iverse coordiate trasformatio to obtai the origial - D coordiates from the mapped - D coordiates ultiply the - D coordiate matrix by proper graphics trasformatio matrix i order to achieve graphical trasformatio. Use the same - D to - D map agai to plot the poit oto the scree. These steps ca be mathematically represeted as: P D = P ( P ' = P T D D D P ' = P ' (15 Or by a sigle-lie expressio P ' = ((P ( T (16 Here as before deotes matrix multiplicatio ad T deotes the traditioal graphics trasformatio matrix. But sice we kow the fact that matrix multiplicatio is associative we have P P ' = ((P where = P = P ' = P ( ' T T T ' = T (17 So usig this simple techique we ca escape the successive matrix multiplicatios everytime a poit o scree eeds to trasformed istead what we ca simply do is pre-compute ' = T. (18 This matrix ' is eeded to be computed oce for a give graphics trasformatio (e.g. rotatio about a axis ad applied to all poits o the scree so that usig a sigle matrix multiplicatio thereafter ay poit o the scree ca udergo graphics trasformatio by P ' = P ' where P represets the poit mapped before trasformatio T ad P is the poit re-mapped after the trasformatio as obvious. Hece usig the above tricks we are able to make the trasformatio more computatioally efficiet.

oreover if a trasformatio is eeded to be applied simultaeously we ca use the property (T = ( T where (T deotes ( times is a positive iteger simultaeous matrix multiplicatio of T. Let s say we have already udergoe a T trasformatio so that we have already computed = T ad let s say that we also have frequet simultaeous (T trasformatio. I order to udergo a (T trasformatio we first eed to compute the matrix (T the we eed to compute our ew matrix = (T so we eed total + matrix multiplicatios everytime we wat a (T trasform for each. But if we have computed T iitially here the trick is that we ca reuse this it to compute our ew matrix i the followig maer: = (T (19 = ( T = ( Here we eed ot compute (T ad every-time istead we eed to compute ( oly (that ca be icremetal multiplicatio to icrease efficiecy. 6. Coclusios This article preseted a very simple method of mappig from - D to - D that is free from ay complex pre-operatio. The proposed techique works with ay graphics system where we have some primitive - D graphics fuctio. We also discussed the iverse trasform ad how to do basic computer graphics trasformatios usig our coordiate mappig system. 7. Refereces [1] Rogers David F Procedural elemets for computer Graphics d editio cgraw-hill 1998 pp. 65-87. [] Rogers David F. Adams J. Ala athematical Elemets for Computer Graphics d editio cgraw-hill 1990 pp. 61-06. [] Ng C.. Bustard D. W. A New Real Time Geometric Trasformatio atrix ad its Efficiet VLSI Implemetatio Computer Graphics Forum December 1994 Vol. 1 pp. 84-85. [4] Shreier Dave Woo aso Neider Jackie Davis Tom OpeGL Programmig Guide Versio 1.4 Fourth Editio Pearso Educatio 004 pp. 10058. [5] Turkowski Ke Fixed-Poit Trigoometry with CORDIC Iteratios Graphics Gems I Academic Press 1990 pp. 494-497. [6] Turkowski Ke The Use of Coordiate Frames i Computer Graphics Graphics Gems I Academic Press 1990 pp. 5-5. [7] Joy Ke O-Lie Computer Graphics Notes Computer Sciece Departmet Uiversity of Califoria Davis 1999. [8] Ducker ike atrix ad Vector aipulatio for Computer Graphics November 9 000. [9] Howlad Joh E. Computer Graphics Departmet of Computer Sciece Triity Uiversity October 4 005. [10] Keith Stepha R. A Trasformatio Structure for Aimated -D Computer Graphics AC SIGGRAPH Computer Graphics Vol. 15 Issue 1 April 1981 pp 7-91.