The document discusses graphics display devices and algorithms for scan converting lines in computer graphics. It describes how a frame buffer stores pixel values and how these values are sent to the display surface. It then examines two algorithms for scan converting lines: an incremental algorithm that calculates the next pixel by incrementing the x and y coordinates, and a midpoint line algorithm that determines which of two potential next pixels is closer by calculating on which side of the line the midpoint lies. The midpoint algorithm avoids errors from rounding and representation that can occur in the incremental approach.
The document discusses graphics display devices and algorithms for scan converting lines on a raster display. It describes how a frame buffer stores pixel values and how the scan controller sends these values to the correct positions on the display surface. It also presents the incremental algorithm for scan converting lines - which finds the equation of the line between two points and then increments pixels along the line based on the slope. Issues with rounding integers in this algorithm are noted.
The document discusses digital electronics and logic gates. It begins with an overview of binary logic, logic gates, and truth tables. It then covers combinational logic circuits and how to design circuits from logic functions. It discusses various logic gates like AND, OR, NOT, NAND and NOR gates. It also covers arithmetic circuits like half adders, full adders, adders, and multipliers. It concludes with an introduction to flip-flops.
The document discusses various techniques for software testing, including:
- White-box testing techniques like control flow-based testing which aims to cover all statements, branches, and paths in the code. Data flow-based testing which aims to cover all def-use pairs to test variable definitions and uses.
- Black-box testing techniques like equivalence partitioning which partitions input/output domains into equivalence classes and tests using values from different classes.
- The benefits of testing include finding bugs, improving quality, and ensuring software meets specifications despite inevitable faults. Thorough testing can help reduce risks even if perfect testing is impossible.
Production Management & Total Quality Managementcpjcollege
The document discusses various forecasting and inventory management techniques. It begins by explaining qualitative and quantitative forecasting methods, including time series models like moving averages and exponential smoothing. It then covers topics like independent and dependent demand for inventory, functions of inventory, and tools for inventory management including ABC analysis, economic order quantity models, reorder points, and classification systems like VED, HML, and FSN.
Data Transformation
Programs transform data from one form to another ◦ Input data → Output data ◦ Stimulus → Response Programming languages store and process data in various ways depending on the type of the data; consequently, all data read, processed, or written by a program must have a type Two distinguishing characteristics of a programming language are the data types it supports and the operations on those data types
What Is A Computer?
A computer is an electronic device, operating under the control of instructions (software) stored in its own memory unit, that can accept data (input), manipulate data (process), and produce information (output) from the processing. Generally, the term is used to describe a collection of devices that function together as a system.
The document discusses the history and evolution of computers over several generations from the first generation of vacuum tube computers to the current fifth generation. It covers the characteristics and technologies of each generation including the transition from vacuum tubes to transistors to integrated circuits. The document also provides an overview of computer hardware, software types including operating systems and applications, and how computers accept input, process and store data, and produce output.
This document contains lecture notes from a class on VB.NET programming and the .NET architecture. It discusses the .NET infrastructure including the common language runtime and portable executable files. It also covers topics like .NET project types, designing applications for .NET, variable scope, arrays and collections, object passing and parameters, inheritance control, threading, delegates, exception handling, object-oriented features in .NET, and ADO.NET concepts like data connections, adapters, datasets and data readers.
The document discusses graphics display devices and algorithms for scan converting lines on a raster display. It describes how a frame buffer stores pixel values and how the scan controller sends these values to the correct positions on the display surface. It also presents the incremental algorithm for scan converting lines - which finds the equation of the line between two points and then increments pixels along the line based on the slope. Issues with rounding integers in this algorithm are noted.
The document discusses digital electronics and logic gates. It begins with an overview of binary logic, logic gates, and truth tables. It then covers combinational logic circuits and how to design circuits from logic functions. It discusses various logic gates like AND, OR, NOT, NAND and NOR gates. It also covers arithmetic circuits like half adders, full adders, adders, and multipliers. It concludes with an introduction to flip-flops.
The document discusses various techniques for software testing, including:
- White-box testing techniques like control flow-based testing which aims to cover all statements, branches, and paths in the code. Data flow-based testing which aims to cover all def-use pairs to test variable definitions and uses.
- Black-box testing techniques like equivalence partitioning which partitions input/output domains into equivalence classes and tests using values from different classes.
- The benefits of testing include finding bugs, improving quality, and ensuring software meets specifications despite inevitable faults. Thorough testing can help reduce risks even if perfect testing is impossible.
Production Management & Total Quality Managementcpjcollege
The document discusses various forecasting and inventory management techniques. It begins by explaining qualitative and quantitative forecasting methods, including time series models like moving averages and exponential smoothing. It then covers topics like independent and dependent demand for inventory, functions of inventory, and tools for inventory management including ABC analysis, economic order quantity models, reorder points, and classification systems like VED, HML, and FSN.
Data Transformation
Programs transform data from one form to another ◦ Input data → Output data ◦ Stimulus → Response Programming languages store and process data in various ways depending on the type of the data; consequently, all data read, processed, or written by a program must have a type Two distinguishing characteristics of a programming language are the data types it supports and the operations on those data types
What Is A Computer?
A computer is an electronic device, operating under the control of instructions (software) stored in its own memory unit, that can accept data (input), manipulate data (process), and produce information (output) from the processing. Generally, the term is used to describe a collection of devices that function together as a system.
The document discusses the history and evolution of computers over several generations from the first generation of vacuum tube computers to the current fifth generation. It covers the characteristics and technologies of each generation including the transition from vacuum tubes to transistors to integrated circuits. The document also provides an overview of computer hardware, software types including operating systems and applications, and how computers accept input, process and store data, and produce output.
This document contains lecture notes from a class on VB.NET programming and the .NET architecture. It discusses the .NET infrastructure including the common language runtime and portable executable files. It also covers topics like .NET project types, designing applications for .NET, variable scope, arrays and collections, object passing and parameters, inheritance control, threading, delegates, exception handling, object-oriented features in .NET, and ADO.NET concepts like data connections, adapters, datasets and data readers.
Planning and Designing for .NET – Programming Language Hierarchy – The .NET Infrastructure – .NET ProjectTypes – Designing for .NET – Application Design Issues
COST ACCOUNTING – MEANING
Cost accounting is concerned with recording, classifying and summarizing costs for determination of costs of products or services, planning, controlling and reducing such costs and furnishing of information to management for decision making.
Registers in Computer Architecture Register is a very fast computer memory, used to store data/instruction in-execution. A Register is a group of flip-flops with each flip-flop capable of storing one bit of information. An n-bit register has a group of n flip-flops and is capable of storing binary information of n-bits.
The document discusses database normalization and its goals. It explains the different normal forms from 1st normal form (1NF) to Boyce-Codd normal form (BCNF) and describes the conditions for a relation to be in each normal form. Functional dependencies and how they relate to normalization are also covered. Specific examples are provided to illustrate functional dependencies, partial dependencies, and how to decompose relations to higher normal forms through lossless joins.
Cost and management accounting• Provides management with costs for products, inventories, operations or functions and compares actual to predetermined data • It also provides a variety of data for many day-to-day decision as well as essential information for long-range decisions
OVERVIEW OF CODD’s RULE
• A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd.
• A short definition of an RDBMS may be a DBMS in which data is stored in the form of tables and the relationship among the data is also stored in the form of tables.
• E.F. Codd, the famous mathematician has introduced 12 rules (0-12)for the relational model for databases commonly known as Codd's rules. The rules mainly define what is required for a DBMS for it to be considered relational, i.e., an RDBMS.
Object oriented programming using BCA 209cpjcollege
This document discusses object oriented programming (OOP) and C++. It provides an overview of procedure oriented programming versus OOP, highlighting that OOP emphasizes data over procedures and uses objects and classes. Characteristics of OOP like encapsulation, inheritance, and polymorphism are covered. The document then discusses C++ features like classes, objects, constructors, destructors, static class members, friend functions, and inline functions. Finally, it introduces templates in C++ as a way to write generic functions and classes that can work with multiple data types.
Cost accounting is concerned with recording, classifying and summarizing costs for determination of costs of products or services, planning, controlling and reducing such costs and furnishing of information to management for decision making.
This document discusses registers in computer architecture. It defines a register as a very fast memory used to store data or instructions being executed. A register consists of a group of flip-flops that can each store one bit. The document also discusses register transfer language, which uses symbolic notation to describe operations between registers, and different types of register transfers and micro-operations that can be performed. It provides examples of shift operations and how an arithmetic logical unit is used to perform logic and arithmetic operations on data from registers.
Excel – Basics
1 Ribbon: The tabs on the ribbon are: File, Home, Insert, Page layout, Formulas, Data, Review and View. Excel selects the ribbon's Home tab when you open a workbook. 2 Workbook: A workbook is another word for your Excel file. When you start Excel, click Blank workbook to create an Excel workbook from scratch. 3 Worksheets: A worksheet is a collection of cells where you keep and manipulate the data. Each Excel workbook can contain multiple worksheets. 4 Format Cells: When we format cells in Excel, we change the appearance of a number without changing the number itself. 5 Find & Select: Learn how to use Excel's Find, Replace and Go To Special feature.
Introduction:
•Service Tax was introduced in 1994 vide Finance Act, 1994 with 3 SERVICES
namely, Brokerage charged by stockbroker, Telephone services & premium on
General Insurance Services. •Applicable to whole of India except Jammu & Kashmir. •Today there are 109 services under section 65(105), which are considered taxable
Object oriented programming
• Object Oriented Programming (OOP) is an approach to program organization and development that attempts to eliminate some of the pitfalls of conventional programming methods by incorporating the best of structured programming features with several powerful new concepts.
The Evolution of Computers, 1st, 2nd, 3rd, 4th & 5th Generation
Computers in the form of personal desktop computers, laptops and tablets have become such an important part of everyday living that it can be difficult to remember a time when they did not exist. In reality, computers as they are known and used today are still relatively new. Although computers have technically been in use since the abacus approximately 5000 years ago, it is modern computers that have had the greatest and most profound effect on society.
The document is a lecture note on basic concepts of taxation from Chanderprabhu Jain College of Higher Studies & School of Law. It defines key terms like taxes, direct and indirect taxes, income, assessment year, financial year. It distinguishes between capital and revenue receipts and discusses the differences between direct and indirect taxes. It also explains the concepts of application of income versus diversion of income and gives examples. Finally, it provides an overview of the different sections related to assessment under the Income Tax Act.
Socio-Legal Dimensions of Gender (LLB-507 & 509 )cpjcollege
This paper intends to sensitize the students about the changing
dimensions of gender and also familiarizes them with the subtle manifestations of inequality rooted in our society.
The objective of the paper is to apprise the students with the laws relating to marriage, dissolution, matrimonial remedies, adoption, contemporary trends in family institutions in India, in particular the Hindus and Muslims.
Alternative Dispute Resolution (ADR) [LLB -309] cpjcollege
Alternative Dispute Resolution has become the primary means by which cases are resolved now days, especially commercial, business disputes. It has emerged as the preferred method for resolving civil cases, with litigation as a last resort. Alternative Dispute Resolution provides an overview of the statutory, procedural, and case law underlining these processes and their interplay with litigation. A significant theme is the evolving role of
professional ethics for attorneys operating in non-adversarial settings. Clients and courts increasingly express a preference for attorneys who are skilled not only in litigation but in problem-solving, which costs the clients less in terms of time, money and relationship. The law of ADR also provides an introduction to negotiation and mediation theory.
Environmental Studies and Environmental Laws (: LLB -301)cpjcollege
The objective of this paper is to acquaint the students with the environmental issues and the measures taken for its protection along with the norms prevailing at international and national
level
Planning and Designing for .NET – Programming Language Hierarchy – The .NET Infrastructure – .NET ProjectTypes – Designing for .NET – Application Design Issues
COST ACCOUNTING – MEANING
Cost accounting is concerned with recording, classifying and summarizing costs for determination of costs of products or services, planning, controlling and reducing such costs and furnishing of information to management for decision making.
Registers in Computer Architecture Register is a very fast computer memory, used to store data/instruction in-execution. A Register is a group of flip-flops with each flip-flop capable of storing one bit of information. An n-bit register has a group of n flip-flops and is capable of storing binary information of n-bits.
The document discusses database normalization and its goals. It explains the different normal forms from 1st normal form (1NF) to Boyce-Codd normal form (BCNF) and describes the conditions for a relation to be in each normal form. Functional dependencies and how they relate to normalization are also covered. Specific examples are provided to illustrate functional dependencies, partial dependencies, and how to decompose relations to higher normal forms through lossless joins.
Cost and management accounting• Provides management with costs for products, inventories, operations or functions and compares actual to predetermined data • It also provides a variety of data for many day-to-day decision as well as essential information for long-range decisions
OVERVIEW OF CODD’s RULE
• A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd.
• A short definition of an RDBMS may be a DBMS in which data is stored in the form of tables and the relationship among the data is also stored in the form of tables.
• E.F. Codd, the famous mathematician has introduced 12 rules (0-12)for the relational model for databases commonly known as Codd's rules. The rules mainly define what is required for a DBMS for it to be considered relational, i.e., an RDBMS.
Object oriented programming using BCA 209cpjcollege
This document discusses object oriented programming (OOP) and C++. It provides an overview of procedure oriented programming versus OOP, highlighting that OOP emphasizes data over procedures and uses objects and classes. Characteristics of OOP like encapsulation, inheritance, and polymorphism are covered. The document then discusses C++ features like classes, objects, constructors, destructors, static class members, friend functions, and inline functions. Finally, it introduces templates in C++ as a way to write generic functions and classes that can work with multiple data types.
Cost accounting is concerned with recording, classifying and summarizing costs for determination of costs of products or services, planning, controlling and reducing such costs and furnishing of information to management for decision making.
This document discusses registers in computer architecture. It defines a register as a very fast memory used to store data or instructions being executed. A register consists of a group of flip-flops that can each store one bit. The document also discusses register transfer language, which uses symbolic notation to describe operations between registers, and different types of register transfers and micro-operations that can be performed. It provides examples of shift operations and how an arithmetic logical unit is used to perform logic and arithmetic operations on data from registers.
Excel – Basics
1 Ribbon: The tabs on the ribbon are: File, Home, Insert, Page layout, Formulas, Data, Review and View. Excel selects the ribbon's Home tab when you open a workbook. 2 Workbook: A workbook is another word for your Excel file. When you start Excel, click Blank workbook to create an Excel workbook from scratch. 3 Worksheets: A worksheet is a collection of cells where you keep and manipulate the data. Each Excel workbook can contain multiple worksheets. 4 Format Cells: When we format cells in Excel, we change the appearance of a number without changing the number itself. 5 Find & Select: Learn how to use Excel's Find, Replace and Go To Special feature.
Introduction:
•Service Tax was introduced in 1994 vide Finance Act, 1994 with 3 SERVICES
namely, Brokerage charged by stockbroker, Telephone services & premium on
General Insurance Services. •Applicable to whole of India except Jammu & Kashmir. •Today there are 109 services under section 65(105), which are considered taxable
Object oriented programming
• Object Oriented Programming (OOP) is an approach to program organization and development that attempts to eliminate some of the pitfalls of conventional programming methods by incorporating the best of structured programming features with several powerful new concepts.
The Evolution of Computers, 1st, 2nd, 3rd, 4th & 5th Generation
Computers in the form of personal desktop computers, laptops and tablets have become such an important part of everyday living that it can be difficult to remember a time when they did not exist. In reality, computers as they are known and used today are still relatively new. Although computers have technically been in use since the abacus approximately 5000 years ago, it is modern computers that have had the greatest and most profound effect on society.
The document is a lecture note on basic concepts of taxation from Chanderprabhu Jain College of Higher Studies & School of Law. It defines key terms like taxes, direct and indirect taxes, income, assessment year, financial year. It distinguishes between capital and revenue receipts and discusses the differences between direct and indirect taxes. It also explains the concepts of application of income versus diversion of income and gives examples. Finally, it provides an overview of the different sections related to assessment under the Income Tax Act.
Socio-Legal Dimensions of Gender (LLB-507 & 509 )cpjcollege
This paper intends to sensitize the students about the changing
dimensions of gender and also familiarizes them with the subtle manifestations of inequality rooted in our society.
The objective of the paper is to apprise the students with the laws relating to marriage, dissolution, matrimonial remedies, adoption, contemporary trends in family institutions in India, in particular the Hindus and Muslims.
Alternative Dispute Resolution (ADR) [LLB -309] cpjcollege
Alternative Dispute Resolution has become the primary means by which cases are resolved now days, especially commercial, business disputes. It has emerged as the preferred method for resolving civil cases, with litigation as a last resort. Alternative Dispute Resolution provides an overview of the statutory, procedural, and case law underlining these processes and their interplay with litigation. A significant theme is the evolving role of
professional ethics for attorneys operating in non-adversarial settings. Clients and courts increasingly express a preference for attorneys who are skilled not only in litigation but in problem-solving, which costs the clients less in terms of time, money and relationship. The law of ADR also provides an introduction to negotiation and mediation theory.
Environmental Studies and Environmental Laws (: LLB -301)cpjcollege
The objective of this paper is to acquaint the students with the environmental issues and the measures taken for its protection along with the norms prevailing at international and national
level
The paper will focus on the civil procedures followed in instituting a suit. The students will be familiarised with certain important concepts and practical skill development activity will provide insights into the actual working of the court procedures.
The objective of this paper is to provide an understanding of basic concepts of Indian Constitution and various organs created by the Constitution and their functions.
The document discusses various topics related to corporate law including types of companies, forms of business organization, shares, debentures, and securities. It provides information on sole proprietorships, partnerships, corporations, limited liability companies (LLCs), and different types of companies such as private companies and public companies. The document also defines key terms like shares, share capital, debentures, debenture bonds, and classifications of company securities.
It is an indispensable complementary part of our legal system without the study of which no advocate is suitably equipped with the basic requisites required to go to the court.
This document provides an overview of key concepts in international relations discussed in a political science class, including:
- Democracy and its key principles such as majority rule, protection of minority rights, and consent of the governed.
- Federalism and its features such as division of powers between central and state/provincial governments.
- The parliamentary system in India and features such as a ceremonial head of state, executive drawn from the legislature, and collective responsibility of ministers.
- Concepts in international relations like power, sovereignty, and the elements and limitations of national power, including international law, morality, and world public opinion.
This paper focuses on various aspects of health care law including the constitutional perspective, obligations, and negligence of medical professionals and remedies available to
consumers of health care.
The object of this paper is to focus on land reforms in India, Constitutional provisions related to land reforms, Land Acquisition, Rehabilitation, and Resettlement Act,2013, Urban Real Estate Development Laws and the Provisions of the Rent Laws under the
Delhi Rent Control Act, 1958.
Business Environment and Ethical Practices (BBA LLB 213 )cpjcollege
The objective of the course is to familiarize students with the different aspects of business environment and ethical practices to be adopted by organizations in conducting their business.
The document provides information about human resource management (HRM) including definitions of HRM, its components, nature, scope, importance, evolution, policies, challenges, and trends. It also discusses the differences between personnel management and HRM as well as HRM and strategic HRM. Additionally, it covers topics related to human resource planning such as meaning, importance, job analysis, and future personnel needs. The document appears to be lecture notes on an introduction to HRM course provided by Ms. Pallavi Sharma.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
1. Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
PAPER NAME: COMPUTER GRAPHICS
PAPER CODE: BCA 303
CLASS: BCA Vth Semester
2. UNIT-I Graphics Display Devices
• Frame Buffer – a region of memory sufficiently large to hold all of the
pixel values for the display
2
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Block
Diagram of
Computer
with Raster
Display
3. Graphics Display Devices - cont
• How each pixel value in the frame buffer is
sent to the right place on the display surface
3
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
4. Graphics Devices – cont
• Each pixel has a 2D address (x,y)
– For each address (x,y) there is a specific memory location
that holds the value of the pixel (I.e. mem[136][252])
– The scan controller sends the logical address (136, 252) to
the frame buffer, which emits the value mem[136][252]
– The value mem[136][252] is converted to a corresponding
intensity or color in the conversion circuit, and that
intensity or color is sent to the proper physical position,
(136, 252), on the display surface
4
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
5. Graphics Devices – cont
• Each pixel has a 2D address (x,y)
– For each address (x,y) there is a specific memory location
that holds the value of the pixel (I.e. mem[136][252])
– The scan controller sends the logical address (136, 252) to
the frame buffer, which emits the value mem[136][252]
– The value mem[136][252] is converted to a corresponding
intensity or color in the conversion circuit, and that
intensity or color is sent to the proper physical position,
(136, 252), on the display surface
5
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
6. Graphics Devices – cont
• Each pixel has a 2D address (x,y)
– For each address (x,y) there is a specific memory location
that holds the value of the pixel (I.e. mem[136][252])
– The scan controller sends the logical address (136, 252) to
the frame buffer, which emits the value mem[136][252]
– The value mem[136][252] is converted to a corresponding
intensity or color in the conversion circuit, and that
intensity or color is sent to the proper physical position,
(136, 252), on the display surface
6
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
7. Graphics Devices – cont
• Each pixel has a 2D address (x,y)
– For each address (x,y) there is a specific memory location
that holds the value of the pixel (I.e. mem[136][252])
– The scan controller sends the logical address (136, 252) to
the frame buffer, which emits the value mem[136][252]
– The value mem[136][252] is converted to a corresponding
intensity or color in the conversion circuit, and that
intensity or color is sent to the proper physical position,
(136, 252), on the display surface
7
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
8. Graphics Devices – cont
• Each pixel has a 2D address (x,y)
– For each address (x,y) there is a specific memory location
that holds the value of the pixel (I.e. mem[136][252])
– The scan controller sends the logical address (136, 252) to
the frame buffer, which emits the value mem[136][252]
– The value mem[136][252] is converted to a corresponding
intensity or color in the conversion circuit, and that
intensity or color is sent to the proper physical position,
(136, 252), on the display surface
8
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
9. Scan Converting Lines
• Line Drawing
– Draw a line on a raster screen between 2 points
– What’s wrong with the statement of the problem?
• It does not say anything about which pts are allowed as
end pts
• It does not give a clear meaning to “draw”
• It does not say what constitutes a “line” in the raster
world
• It does not say how to measure the success of the
proposed algorithm
9
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
10. Graphics Devices – cont
• Each pixel has a 2D address (x,y)
– For each address (x,y) there is a specific memory location
that holds the value of the pixel (I.e. mem[136][252])
– The scan controller sends the logical address (136, 252) to
the frame buffer, which emits the value mem[136][252]
– The value mem[136][252] is converted to a corresponding
intensity or color in the conversion circuit, and that
intensity or color is sent to the proper physical position,
(136, 252), on the display surface
10
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
11. Scan Converting Lines - cont
• Problem Statement
– Given 2 points P and Q in the plane, both with
integer coordinates, determine which pixels on a
raster screen should be “on” in order to make a
picture of a unit-width line segment starting at
point P and ending at point Q
11
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
12. Finding the next pixel
• Special Case:
– Horizontal Line:
• Draw pixel P and increment the x coordinate value by one to get
the next pixel.
– Vertical Line:
• Draw the pixel P and increment the y coordinate value by one to
get the next pixel
– Diagonal Line:
• Draw the pixel P and increment both the x and y coordinate values
by one to get the next pixel
– What should we use in the general case?
12
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
13. Vertical Distance
• Why can we use the vertical distance as
a measure of which point is closer?
– Because vertical distance is proportional to
the actual distance
– How do we show this?
– Congruent Triangles
13
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
14. Vertical Distance – cont
• By similar triangles we can see that the true
distances to the line (in blue) are directly
proportional to the vertical distances to the
line (in black) for each point.
• Therefore the point with the smaller vertical
distance to the line is the closest to the line
14
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
15. Strategy 1 – Incremental Algorithm
• The Basic Algorithm
– Find the equation of the line that connects
the 2 points P and Q
– Starting with the leftmost point P, increment
by 1 to calculate where A =
slope, and B = y intercept
– Intensify the pixel at
– This computation selects the closest pixel, the
pixel whose distance to the “true” line is
smallest
15
ix
BAxy ii
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
16. Strategy 1 – Incremental Algorithm
• The Incremental Algorithm
– Each iteration requires a floating-point
multiplication therefore, modify
– If , then
– Thus, a unit change in x changes y by slope A,
which is the slope of the line
– At each step, we make incremental calculations
based on the preceding step to find the next y
value
16
xAyBxxABAxY iiii 11
1x Ayy ii 1
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
17. Strategy 1 – Incremental Algo
17
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
18. Example Code
18
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
19. Problem with the Incremental Algorithm
• Rounding integers takes time
• Real variables have limited precision, summing
an inexact slope (A) repetitively introduces a
cumulative error buildup
• Variables y and A must be a real or fractional
binary because the slope is a fraction
– Special case needed for vertical lines
19
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
20. Strategy 2 – Midpoint Line Algorithm
• Assume that the line’s slope is shallow and positive ( 0 <
slope < 1); other slopes can be handled by suitable
reflections about the principle axes
• Call the lower left endpoint and the upper
right endpoint
• Assume that we have just selected the pixel P at
• Next, we must choose between the pixel to the right
(pixel E), or one right and one up (pixel NE)
• Let Q be the intersection point of the line being scan-
converted with the grid line
20
0,0 yx
11, yx
pp yx ,
1 pxxChanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
21. Strategy 2 – Midpoint Line Algorithm
1/1/2000 21
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
22. Strategy 2 – Midpoint Line Algorithm
• The line passes between E and NE
• The point that is closer to the intersection point Q must be
chosen
• Observe on which side of the line the midpoint M lies:
– E is closer to the line if the midpoint lies above the line (I.e. the line
crosses the bottom half)
– NE is closer to the line if the midpoint lies below the line, I.e., the line
crosses the top half
• The error, the vertical distance between the chosen pixel and
the actual line is always <= ½
• The algorithm chooses NE as the next pixel for the line shown
• Now, find a way to calculate on which side of the line the
midpoint lies
22
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
23. The Line
• The line equation as a function f(x):
– f(x) = A*x + B = dy/dx * x + B
• Line equation as an implicit function:
– F(x,y) = a * x + b * y + c = 0 for coefficients a, b, c where a, b != 0; from
above, y *dx = dy*x + B*dx, so a = dy, b = -dx,
c=B *dx, a>0 for y(0) < y(1)
• Properties (proof by the case analysis):
– when any point M is on the line
– when any point M is above the line
– when any point M is below the line
– Our decision will be based on the value of the function at the midpoint
M at
23
0)( , mm yxF
0),( mm yxF
0),( mm yxF
2
1,1 pp yx
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
24. Decision Variable
• Decision Variable d:
– We only need the sign of to see where
the line lies, and then pick the nearest pixel
–
• If d > 0 choose pixel NE
• If d < 0 choose pixel E
• If d = 0 choose either one consistently
• How to update d:
– On the basis of picking E or NE, figure out the location of
the M for that pixel, and the corresponding value of d for
the next grid line
24
)
2
1,1( pp yxF
),1( 2
1 pp yxFD
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
25. Example Code
25
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
26. Rotation About the Origin
To rotate a line or polygon, we must rotate
each of its vertices.
To rotate point (x1,y1) to point (x2,y2) we
observe:
From the illustration we know that:
sin (A + B) = y2/r cos (A + B) = x2/r
sin A = y1/r cos A = x1/r
x-axis
(x1,y1)
(x2,y2)
A
B
r
(0,0)
y-axis
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
UNIT-II 2-D TRANSFORMATIONS
27. Rotation About the Origin
From the double angle formulas: sin (A + B) =
sinAcosB + cosAsinB
cos (A + B)= cosAcosB -
sinAsinB
Substituting: y2/r = (y1/r)cosB +
(x1/r)sinB
Therefore: y2 = y1cosB + x1sinB
We have x2 = x1cosB -
y1sinB
P2 = R P1
.
(x1)
(y1)
(cosB -sinB)
(sinB cosB)
(x2)
(y2) =
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
28. Translations
Moving an object is called a translation. We translate a point by adding to
the x and y coordinates, respectively, the amount the point should be
shifted in the x and y directions. We translate an object by translating
each vertex in the object.
P2 = P1 + T
T = ( tx )
( ty )
P1 = ( x1 )
( y1 )
P2 = (x1 + tx)
(y1 + ty)
Ty
Tx
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
29. Scaling
Changing the size of an object is called a scale. We scale an object by scaling
the x and y coordinates of each vertex in the object.
P2 = S P1
.
S = (sx 0)
(0 sy)
P1 = ( x1 )
( y1 )
P2 = (sxx1)
(syy1)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
30. Homogeneous Coordinates
Although the formulas we have shown are usually the most efficient way to
implement programs to do scales, rotations and translations, it is easier to use
matrix transformations to represent and manipulate them.
In order to represent a translation as a matrix operation we use 3 x 3 matrices
and pad our points to become 1 x 3 matrices.
cos ø -sin ø 0
Rø = sin ø cos ø 0
0 0 1
Sx 0 0
S = 0 Sy 0
0 0 1
1 0 Tx
T = 0 1 Ty
0 0 1
Point P =
(x)
(y)
(1)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
31. Composite Transformations - Scaling
Given our three basic transformations we can create other
transformations.
Scaling with a fixed point
A problem with the scale transformation is that it also moves the
object being scaled.
Scale a line between (2, 1) (4,1) to twice its length.
(2 0 0) =
(0 1 0)
(0 0 1)
(2 0 0) =
(0 1 0)
(0 0 1)
0 1 2 3 4 5 6 7 8 9 10
Before
After
(2)
(1)
(1)
(4)
(1)
(1)
(4)
(1)
(1)
(8)
(1)
(1)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
32. Composite Transforms - Scaling (cont.)
If we scale a line between (0, 1) (2,1) to twice its length, the left-
hand endpoint does not move.
(2 0 0) =
(0 1 0)
(0 0 1)
(2 0 0) =
(0 1 0)
(0 0 1)
(0,0) is known as a fixed point for the basic scaling transformation.
We can used composite transformations to create a scale
transformation with different fixed points.
0 1 2 3 4 5 6 7 8 9 10
Before
After
(0)
(1)
(1)
(0)
(1)
(1)
(2)
(1)
(1)
(0)
(1)
(1)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
33. Fixed Point Scaling
Scale by 2 with fixed point = (2,1)
• Translate the point (2,1) to the origin
• Scale by 2
• Translate origin to point (2,1)
(1 0 2) (2 0 0) (1 0 -2) = (2 0 -2)
(0 1 1) (0 1 0) (0 1 -1) (0 1 0)
(0 0 1) (0 0 1) (0 0 1) (0 0 1)
(2 0 -2) =
(0 1 0)
(0 0 1)
(2 0 -2) =
(0 1 0)
(0 0 1)
0 1 2 3 4 5 6 7 8 9 10
Before
After
(2)
(1)
(1)
(2)
(1)
(1)
(4)
(1)
(1)
(6)
(1)
(1)Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
34. More Fixed Point Scaling
Scale by 2 with fixed point = (3,1)
• Translate the point (3,1) to the origin
• Scale by 2
• Translate origin to point (3,1)
(1 0 3) (2 0 0) (1 0 -3) = (2 0 -3)
(0 1 1) (0 1 0) (0 1 -1) (0 1 0)
(0 0 1) (0 0 1) (0 0 1) (0 0 1)
(2 0 -3) =
(0 1 0)
(0 0 1)
(2 0 -3) =
(0 1 0)
(0 0 1)
0 1 2 3 4 5 6 7 8 9 10
Before
After
(2)
(1)
(1)
(1)
(1)
(1)
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
35. Shears
Original Data y Shear x Shear
1 0 0 1 b 0
a 1 0 0 1 0
0 0 1 0 0 1
GRAPHICS --> x shear --> GRAPHICS
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
36. Reflections
Reflection about the y-axis Reflection about the x-axis
-1 0 0 1 0 0
0 1 0 0 -1 0
0 0 1 0 0 1
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
37. More Reflections
Reflection about the origin Reflection about the line y=x
-1 0 0 0 1 0
0 -1 0 1 0 0
0 0 1 0 0 1
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
38. Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
UNIT-III
SOLID MODELING
39. UNIT-III SOLID MODELING
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
Start with these four, three-view drawings – Parts 1, 2, 3, 4 below and project
all points around to show alignment of one object.
40. Part 1 - Extrude front view (.75) inches to finish. Why front view ? Because
it shows the most of the object in solid format, and all I had to do was to add
depth onto the object. The width and height already exist. With width and
height given in front view just add depth as shown (.75).
TOP
FRONT RT. SIDE
EXTRUDE FRONT VIEW .75 INCHES TO FINISH.
WHY FRONT VIEW? BECAUSE IT SHOWS THE
MOST OF OBJECT IN SOLID FORMAT, AND ALL I
HAD TO DO WAS TO ADD DEPTH ONTO THE
OBJECT THAT ALREADY HAD WIDTH & HEIGHT.
0.75
0.75
TOP
FRONT RT. SIDE
WIDTH
DEPTH
TO FINISH OBJECT PLACE DEPTH ON
TO THE WIDTH AND HEIGHT ALREADY
GIVEN IN FRONT VIEW.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
41. Part 2 - From the top choose this part and with a polyline extrude it (1.5)
inches by placing the height onto the depth. Move it, align it to midpoint, and
union it to form one part.
TOP
FRONT RT. SIDE
1
2
From the top choose this part and with a
polyline line extrude it 1.5 inches by
placing the height on depth
Move it, align it to
midpoint and union
it to form one part.
You can do this many ways
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
42. Part 3 - What view would you pick to turn this drawing into parametric solid?
(front view)
TOP
FRONT RT. SIDE
1.00
1.00 1.00
2.50
1.00
Part 3 - What view would you pick to make a parametric solid? .
You only need one move. Hint - place the height onto the
width.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
43. Part 4 - What part best describes this object? (1 of right side view) The command you
use is extrude. What second best part would you pick? (2 of right side view) Then also
extrude. Now move number 1 to midpoint of number 2 midpoint and union.
FRONT
TOP
RT. SIDE
PART 4 What 2 Parts would best describe the object?
The command you would use is extrude. What second
part would you pick? Then also extrude. Now move to
midpoint and union it.
If you picked 1 and 2 you are right.
1
2
0.50
2.00
1.50
1.00
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
45. Drawing 2
See if you can turn these three-view drawings into solids.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
46. Drawing 2
Lets start with top view (shows most overall shape). Extrude up (.48) inch and place in
two (.25) inch holes and subtract out the space. Place to side. Extrude back part (2.13)
inches. Move to side. Extrude part 3 back (1.50) of a inch, and move to side. Rotate
part 2 and part 3 parallel to part 1 position and stack them on top to finish object, as
shown in part 5.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
47. Drawing 2 as Solid Model
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
48. Drawing 3 – three-view
Copy all drawings and insert into CAD,
then shade these to get better picture.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
49. Drawing 3
Three parts - red trace in a polyline for the overall shape and extrude down (.50)
inches. Second, place in a (.25) hole and subtract out hole. Yellow draw in with a
polyline for its overall shape and extrude it (.50) of a inch. Part magenta polyline in
over shape and extrude back (.75). Place in red parallel top of yellow (as shown)
place in magenta to the midpoint of yellow (as shown) and move to right side.
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
50. Drawing 3 as Solid Model
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
51. Drawing 4
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
52. Drawing 4 as Solid Model
Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
53. Chanderprabhu Jain College of Higher Studies & School of Law
Plot No. OCF, Sector A-8, Narela, New Delhi – 110040
(Affiliated to Guru Gobind Singh Indraprastha University and Approved by Govt of NCT of Delhi & Bar Council of India)
UNIT-IV
HIDDEN SURFACE
REMOVAL
54. UNIT-IV HIDDEN SURFACE REMOVAL(Visibility)
• Assumption: All polygons are opaque
• What polygons are visible with respect to your view frustum?
Outside: View Frustum Clipping
Remove polygons outside of the view volume
For example, Liang-Barsky 3D Clipping
Inside: Hidden Surface Removal
Backface culling
Polygons facing away from the viewer
Occlusion
Polygons farther away are obscured by closer polygons
Full or partially occluded portions
• Why should we remove these polygons?
Avoid unnecessary expensive operations on these polygons later
58. Occlusion: Full, Partial, None
Full Partial None
• The rectangle is closer than the triangle
• Should appear in front of the triangle
59. Backface Culling
• Avoid drawing polygons facing away from the viewer
Front-facing polygons occlude these polygons in a closed polyhedron
• Test if a polygon is front- or back-facing?
front-facing
back-facing
Ideas?
60. Detecting Back-face Polygons
• The polygon normal of a …
front-facing polygon points towards the viewer
back-facing polygon points away from the viewer
If (n v) > 0 “back-face”
If (n v) ≤ 0 “front-face”
v = view vector
• Eye-space test … EASY!
“back-face” if nz < 0
• glCullFace(GL_BACK)
back
front
61. Polygon Normals
• Let polygon vertices v0, v1, v2,..., vn - 1 be in counterclockwise
order and co-planar
• Calculate normal with cross product:
n = (v1 - v0) X (vn - 1 - v0)
• Normalize to unit vector with n/║n║
v0
v1
v2
v3
v4
n
62. Normal Direction
• Vertices counterclockwise Front-facing
• Vertices clockwise Back-facing
0
1
2
0
2
1
Front facing Back facing
63. Painter’s Algorithm (1)
• Assumption: Later projected polygons overwrite earlier projected polygons
Graphics Pipeline
1 12 23 3
Oops! The red polygon
Should be obscured by
the blue polygon
64. Painter’s Algorithm (2)
• Main Idea
A painter creates a picture by
drawing background scene
elemens before foreground
ones
• Requirements
Draw polygons in back-to-
front order
Need to sort the polygons by
depth order to get a correct
image
from Shirley
68. Painter’s Algorithm (6)
• Cyclic Overlap
How do we sort these three polygons?
• Sorting is nontrivial
Split polygons in order to get a total ordering
Not easy to do in general
69. Visibility
• How do we ensure that closer polygons overwrite further ones in general?
70. Z-Buffer
• Depth buffer (Z-Buffer)
A secondary image buffer that holds depth values
Same pixel resolution as the color buffer
Why is it called a Z-Buffer?
After eye space, depth is simply the z-coordinate
• Sorting is done at the pixel level
Rule: Only draw a polygon at a pixel if it is closer than a
polygon that has already been drawn to this pixel
73. Z-Buffer
• How do we calculate the depth values on the polygon interior?
P1
P2
P3
P4
ys za zp zb
Scanline order
)(
)(
)(
)(
)(
)(
)(
)(
)(
ba
pa
abap
s
b
s
a
xx
xx
zzzz
yy
yy
zzzz
yy
yy
zzzz
21
1
121
41
1
141
Bilinear Interpolation
78. Z-buffering in OpenGL
• Create depth buffer by setting GLUT_DEPTH flag in
glutInitDisplayMode()or the appropriate flag in the
PIXELFORMATDESCRIPTOR.
• Enable per-pixel depth testing with glEnable(GL_DEPTH_TEST)
• Clear depth buffer by setting GL_DEPTH_BUFFER_BIT in glClear()