Monday 28 March 2016

Computer Graphics Lab Project 2: Drawing the Circle

Computer Graphics (ITEC-613) Lab Project 2: Drawing the Circle 
By: Dr. Zeeshan Bhatti 


Task 1: Draw the Circle using the simple Polynomial Method using CPP or JAVA

Basic Algorithm
For x= -R to R
      y = sqrt(R2 - x2)
       PlotPixel(x, round(y) );
       PlotPixel(x, - round(y) );
end;

Solution in Matlab: 

x = 0;
R = 10;
R1 = -R;

x = R1 : 1 : R ;
y= sqrt(R.^2 - x.^2);

plot (x, y, '.' ,  x, -y , 'x' ), xlabel('x-axis'), ylabel('y-axis'), title('Draw Line Graph '), 
        grid off , axis([-10 10 -10 10]);


Task 2: Write the code for creating a Circle using Bresenhams Algorithm for all 8 octants.
Circle Octants



NOTE: 


This is a Lab project, to be done and submitted by each individual student during the Lab, every week. Each student has to do the tasks given, print the Source Code, and get it signed by the lecturer during each lab. Each Lab project has Marks which will be given during the final exam, and the final Viva Vice will also be conducted from these lab projects. Therefore, Each student MUST complete these tasks individually and get it signed during the lab session and finally Must bring all the Lab Project files during the final Viva Vice for input of Marks.

Computer Graphics (ITEC-613) Lab Project 1 : Drawing the Line

Computer Graphics (ITEC-613) Lab Project 1 : Drawing the Line

BSIT P-IV
By: Dr. Zeeshan Bhatti


NOTE: 
This is a Lab Project, to be done and submitted by each individual student during the Lab, every week. Each student has to do the tasks given, print the Source Code, and get it signed by the lecturer during each lab. Each Lab project has Marks, which will be given during the final exam, and the final Viva Vice will also be conducted from these lab projects. Therefore, each student MUST complete these tasks individually and get it signed during the lab session and finally they will be required to  bring all the Lab Project files during the final Viva Vice for input of Marks. 


Task 1: Write the code to create the line using DDA, in Matlab or CPP

Task 2: Write the code to create the line using Bresenham Line Drawing Algorithm in Matlab or CPP

Task 3: Create a custom myLine function in C++ or Java using DDA or Bresenhams algorithm
                            void myLine(x0, y0 ,x1 ,y1){ DDA logic …. }

Task 4: Create a custom Rectangle Function using your own myLine() function. The rectangle function should create a rectangle using four lines as fallow:

void myRectangle(int x0, int y0, int x1, int y1) {
    myLine(                       ); \\Line 1
    myLine(                       ) ; \\Line 2
    myLine(                       ); \\ Line 3
    myLine(                       ); \\Line 4

 }
Task 4: Draw Rectangle


Sunday 27 March 2016

Graphics Programming in JAVA : Lab Handout

Computer Graphics (ITEC-613) Java Lab Handout

BS(IT) P-IV First Semester 2016
Lab Handout: 2                 
Graphics Programming in JAVA
By: Dr. Zeeshan Bhatti

Sample Program

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.*;

public class Java2DFrame extends javax.swing.JFrame {
   
    public Java2DFrame() {
        initComponents();
    }
   
    /**
     * This is the method where the graphic objects are drawn.
     *
     */
    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
        Line2D lin = new Line2D.Float(100, 100, 250, 260);
        g2.draw(lin);
       
        g2.draw(new Rectangle2D.Double(10, 50, 100, 100));
                              
         g2.draw(new RoundRectangle2D.Double(200, 200, 100, 100,  50, 50));                     
    }
   
     private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        this.setBounds(0,0,400,400);
        this.setLayout(null);
        pack();
    }
   
    /**
     * Starts the program
     *
     */
    public static void main(String args[]) {
                new Java2DFrame().setVisible(true);
    }
}

Drawing Geometric Primitives in JAVA
The Java 2D™ API provides several classes that define common geometric objects such as points, lines, curves, and rectangles. These geometry classes are part of the java.awt.geom package.
The
 PathIterator interface defines methods for retrieving elements from a path.
The
 Shape interface provides a set of methods for describing and inspecting geometric path objects. This interface is implemented by the GeneralPath class and other geometry classes.
All examples represented in this section create geometries by using java.awt.geom and then render them by using the Graphics2D class. To begin you obtain a Graphics2D object, for example by casting theGraphics parameter of the paint() method.
public void paint (Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    ...
}

Point

The Point class creates a point representing a location in (x,y) coordinate space. The subclassesPoint2D.Float and Point2D.Double provide correspondingly float and double precision for storing the coordinates of the point.
 
//Create Point2D.Double
Point2D.Double point = new Point2D.Double(x, y);

Line

The Line2D class represents a line segment in (x, y) coordinate space. The Line2D.Float andLine2D.Double subclasses specify lines in float and double precision. For example:
// draw Line2D.Double
g2.draw(new Line2D.Double(x1, y1, x2, y2));


Line

This class includes several setLine() methods to define the endpoints of the line.
Aternatively, the endpoints of the line could be specified by using the constructor for the
 Line2D.Float class as follows:
  • Line2D.Float(float X1, float Y1, float X2, float Y2)
  • Line2D.Float(Point2D p1, Point2D p2)
Use the Stroke object in the Graphics2D class to define the stroke for the line path.

Curves

The java.awt.geom package enables you to create a quadratic or cubic curve segment.
Curve

1.   Quadratic Curve Segment

The QuadCurve2D class implements the Shape interface. This class represents a quadratic parametric curve segment in (x, y) coordinate space. The QuadCurve2D.Float and QuadCurve2D.Double subclasses specify a quadratic curve in float and double precision.
// create new QuadCurve2D.Float
QuadCurve2D q = new QuadCurve2D.Float();
// draw QuadCurve2D.Float with set coordinates
q.setCurve(x1, y1, ctrlx, ctrly, x2, y2);
g2.draw(q);

2.   Cubic Curve Segment

The CubicCurve2D class also implements the Shape interface. This class represents a cubic parametric curve segment in (x, y) coordinate space. CubicCurve2D.Float and CubicCurve2D.Double subclasses specify a cubic curve in float and double precision.
 
// create new CubicCurve2D.Double
CubicCurve2D c = new CubicCurve2D.Double();
// draw CubicCurve2D.Double with set coordinates
c.setCurve(x1, y1, ctrlx1, 
                 ctrly1, ctrlx2, ctrly2, x2, y2);
g2.draw(c);

 Cubic Curve

Rectangle

The Rectangle2D class represents a rectangle defined by a location (x, y) and dimension (w x h). TheRectangle2D.Float and Rectangle2D.Double subclasses specify a rectangle in float and double precision. For example:
// draw Rectangle2D.Double
g2.draw(new Rectangle2D.Double(x, y,
                               rectwidth,
                               rectheight));

The RoundRectangle2D class represents a rectangle with rounded corners defined by a location (x, y), a dimension (w x h), and the width and height of the corner arc. The RoundRectangle2D.Float andRoundRectangle2D.Double subclasses specify a round rectangle in float and double precision.
The rounded rectangle is specified with following parameters:
  • Location
  • Width
  • Height
  • Width of the corner arc
  • Height of the corner acr
To set the location, size, and arcs of a RoundRectangle2D object, use the method setRoundRect(double a, double y, double w, double h, double arcWidth, double arcHeight). For example:
 
// draw RoundRectangle2D.Double
g2.draw(new RoundRectangle2D.Double(x, y,
                                   rectwidth,
                                   rectheight,
                                   10, 10));

 

Ellipse

The Ellipse2D class represents an ellipse defined by a bounding rectangle. The Ellipse2D.Float andEllipse2D.Double subclasses specify an ellipse in float and double precision.
Ellipse is fully defined by a location, a width and a height. For example:
// draw Ellipse2D.Double
g2.draw(new Ellipse2D.Double(x, y,
                             rectwidth,
                             rectheight));

Arc

To draw a piece of an ellipse, you use the Arc2D class. This class represents an arc defined by a bounding rectangle, a start angle, an angular extent, and a closure type. The Arc2D.Float and Arc2D.Doublesubclasses specify an ellipse in float and double precision.
The Arc2D class defines the following three types of arcs, represented by corresponding constants in this class: OPEN, PIE and CHORD.
Several methods set the size and parameters of the arc:
  • Directly, by coordinates
  • By supplied Point2D and Dimension2D
  • By copying an existing Arc2D
Also, you can use the setArcByCenter method to specify an arc from a center point, given by its coordinates and a radius.
// draw Arc2D.Double
g2.draw(new Arc2D.Double(x, y,
                         rectwidth,
                         rectheight,
                         90, 135,
                         Arc2D.OPEN));





Tuesday 22 March 2016

In a bad mood? Take a whiff of your cellphone

In a bad mood? Take a whiff of your cellphone


(Tech innovators are adding a fourth dimension to gadgets and devices: the sense of smell

Source (http://adriancheok.info/category-media/in-a-bad-mood-take-a-whiff-of-your-cellphone-guardian/)

Smell remains the most mysterious of the human senses – scientists are still trying to explain why one scent is pleasant to some people and offensive to others, how fragrances conjure memories from years past, and how aromas influence behavior.

Transfer Taste 
This device analyzes aromas at Reading Scientific Services, part of Reading University in the UK. Such research could help product developers create digital scent experiences that better mimic the real world. Photograph: Frantzesco Kangaris for the Guardian

“The relationship between individual aromas and emotions can vary considerably from one person to another,” says Beverley Hawkins of the West Coast Institute of Aromatherapy. “There is no guarantee that two people smelling the same aroma will trigger the same memories or emotions. In fact, more often than not, they will not.”

A study released earlier this year by the Proceedings of the National Academy of Sciences (PNAS) supports Hawkins’ thought. Researchers found that the genes the body uses to detect scents vary up to 30% in any two given individuals. They concluded that each person has an “olfactory fingerprint” that triggers a unique reaction to the same odor molecule.



On average, a person experiences about 10,000 scents in a day. “Accordingly, it only makes sense that some of these are more pleasing than others to your senses,” says Elizabeth Musmanno, president of the Fragrance Foundation. “And this in turn absolutely affects your mood.”

Making smell digital

Scientists have long known that the sense of smell serves as a type of bodyguard, warning people about dangers such as spoiled food or a fire. And there is a clear connection between the sense of smell and the sense of taste. Yet despite their strong impact on our bodies, those two senses are often not at the forefront of our minds as we go about our daily routines – mealtimes being the exception, of course.

“All nutrients that enter our body are monitored by the senses of taste and smell, so these senses are very important in general,” says Dr Richard Doty, director of the Smell and Taste Center at the University of Pennsylvania. “Unfortunately they are taken for granted until they become injured or otherwise disabled.”

That could change as product developers move closer toward creating digital experiences that better mimic the real world. For example, Oscar Mayer collaborated with computer scientist Adrian Cheok to design a phone attachment that releases the scent of bacon – and plays the sound of frying – at a preset time. The Wake Up and Smell the Bacon project won the Most Creative Use of Technology prize at the 2015 Shorty Awards


This content is paid for by SC Johnson

Monday 21 March 2016

Multimedia Technology (ITEC-526-526) Regular - Evening Result Sheet - Lab

Multimedia Technology (ITEC-526-526) 

Regular - Evening

Result Sheet - Theory and Lab

 
































Academic Year: 2015



BS (IT) P- III Second Semester Regular Examination 2015 EVENING





Course Title: Multimedia Technology
LAB/VIVA


Course No: ITEC-620
REGULAR








Examination held on: _________________
12/2/2015





Award List



Serial # Roll No. Name Total out of 100 Marks in Words









1 2013/BSIT/001 Aamir Ali Mumtaz Ali Kandhro 80 Eighty A

2 2013/BSIT/002 Aatoo Bhounr Bheel 40 Forty D

3 2013/BSIT/003 Abdul Rahman Haji Ghulam 40 Forty D

4 2013/BSIT/004 Abdul Samad Jan Muhammad Brohi 81 Eighty One A

5 2013/BSIT/005 Abdul Shakoor Mohib Ali Lakhan 80 Eighty A

6 2013/BSIT/011 Ali Raza Muhammad Hanif Rajput 70 Seventy B

7 2013/BSIT/012 Amjad Raffique 60 Sixty B

8 2013/BSIT/013 Arif Ali Muhamamd Siddique Malik 80 Eighty A

9 2013/BSIT/015 Asadullah Haji Ali Asghar Brohi 81 Eighty One A

10 2013/BSIT/016 Ayaz Ahmed Ahmed Nawaz Awan 40 Forty D

11 2013/BSIT/017 Azhar Uddin Qutub Uddin Panhwar 61 Sixty One B

12 2013/BSIT/018 Babar Ahmed Saeed Ahmed Siddiqi 60 Sixty B

13 2013/BSIT/024 Dilshad Ali Muhammad Ali Abbasi 82 Eighty Two A

14 2013/BSIT/025 Fahad Latif Abdul Latif Memon 50 Fifty C

15 2013/BSIT/026 Faizan Ali Noor Muhammad Lashari 83 Eighty Three A

16 2013/BSIT/027 Farooque Ahmed Haji Ahmed Channa 63 Sixty Three B

17 2013/BSIT/028 Fiaz Ali Ishtiaque Ahmed Khaskheli 61 Sixty One B

18 2013/BSIT/034 Habibullah Mehboob Ali Satti 53 Fifty Three C

19 2013/BSIT/035 Illahi Bux Gulab Khan Soomro 84 Eighty Four A

20 2013/BSIT/036 Intzar Mehdi Muhammad Juman Bukero 85 Eighty Five A

21 2013/BSIT/038 Iram Anwar Ali Chaaran 70 Seventy B

22 2013/BSIT/040 Javed Ahmed Mehar Khan Shar 82 Eighty Two A

23 2013/BSIT/041 Junaid Ahmed Shah Murad Lanjwani 80 Eighty A

24 2013/BSIT/046 Muhammad Adil Ali Nawaz Qureshi 40 Forty D

25 2013/BSIT/047 Muhammad Asad Abbas Muhammad 71 Seventy One B

26 2013/BSIT/048 Muhammad Aslam Anb Khan Sarki 80 Eighty A

27 2013/BSIT/049 Muhammad Bakhsh Gohar Ali Gorar 70 Seventy B

28 2013/BSIT/050 Muhammad Hareef Haji Daho Dahani 40 Forty D

29 2013/BSIT/051 Muhammad Hassan 40 Forty D

30 2013/BSIT/052 Muhammad Imran Muhammad Sharif 80 Eighty A

31 2013/BSIT/053 Muhammad Imran Muhammad Suleman 70 Seventy B

32 2013/BSIT/056 Muhammad Yaseen Muhammad Essa 82 Eighty Two A

33 2013/BSIT/057 Mumtaz Ali Muhammad Hassan Jakhro 70 Seventy B

34 2013/BSIT/058 Nadir Ali Iqbal Hussain Jatoi 42 Forty Two D

35 2013/BSIT/059 Naseer Ahmed Dahroon Lakho 62 Sixty Two B

36 2013/BSIT/060 Naveed Ali Muhammad Hussain Kalhoro 40 Forty D

37 2013/BSIT/061 Nisar Ahmed Ghulam 61 Sixty One B

38 2013/BSIT/064 Owais Muhamamd Mehmood Isran 70 Seventy B

39 2013/BSIT/065 Pireh Inayatulah Lohar 81 Eighty One A

40 2013/BSIT/066 Raimal Singh Padam Singh Thakur 72 Seventy Two B

41 2013/BSIT/067 Rasheed Saleh Muhammad/sodho Khan 61 Sixty One B

42 2013/BSIT/069 Shaista Muhammad Ramzan Brohi 85 Eighty Five A

43 2013/BSIT/071 Sajad Ali Ghulam Siddique Siyal 70 Seventy B

44 2013/BSIT/072 Saleem Ali Faizal Siyal 80 Eighty A

45 2013/BSIT/073 Abdul Haseeb Buriro Ahsan Ali 84 Eighty Four A

46 2013/BSIT/074 Shafique Ahmed Ashique Ali Soomro 85 Eighty Five A

47 2013/BSIT/075 Shafquat Ali Barkat Ali Hakro 71 Seventy One B

48 2013/BSIT/076 Shahbaz Ali Sadique Ali Arain 70 Seventy B

49 2013/BSIT/078 Shaheer Khan Nasir Khan Khan 71 Seventy One B

50 2013/BSIT/079 Shahid Nazir Nazir Ahmed Noonari 44 Forty Four D

51 2013/BSIT/080 Ajay Kumar Bheemoon Mal Joyo 70 Seventy B

























Academic Year: 2015



BS (IT) P- III Second Semester Regular Examination 2015 EVENING





Course Title: Multimedia Technology
LAB/VIVA


Course No: ITEC-620
REGULAR








Examination held on: _________________
12/2/2015





Award List



Serial # Roll No. Name Total out of 100 Marks in Words









52 2013/BSIT/081 Anees Ur Rahman Gul 43 Forty Three D

53 2013/BSIT/083 Sijad Ali Muhammad Umar Jariko 45 Forty Five D

54 2013/BSIT/084 Sohail Fatah Abdul Fatah Umrani 61 Sixty One B

55 2013/BSIT/091 Yasir Ali Ali Anwar Pirzado 70 Seventy B

56 2013/BSIT/092 Zahid Hussain Allah Dino Hingoro 84 Eighty Four A

57 2013/BSIT/094 Zulifqar Ali Qurban Ali Baber 83 Eighty Three A

58 2013/BSIT/096 Fazal Muhammad Himat Ali Jamali 61 Sixty One B

59 2013/BSIT/098 Touqeer Tariq Muhammad Tariq Mughal 60 Sixty B

60 2013/BSIT/099 Aamir Khan Ghulam Akbar Bhutto 70 Seventy B

61 2013/BSIT/100 Abdul Mueed Abdul Naeem Khatri 60 Sixty B

62 2013/BSIT/101 Allah Warayo Khamiso Khan Chano 40 Forty D

63 2013/BSIT/102 Amjad Ali Shafi Muhammad Panhwer 85 Eighty Five A

64 2013/BSIT/103 Aroon Kumar Roop Chand Sonaro 85 Eighty Five A

65 2013/BSIT/104 Ashfaque Ahmed Muammad 81 Eighty One A

66 2013/BSIT/105 Ashfaque Ali Zulfiqar Ali Jat 60 Sixty B

67 2013/BSIT/106 Asif Ali Ghazi Khan Khoso 84 Eighty Four A

68 2013/BSIT/108 Bashir Ahmed Kareemdad Noohani 60 Sixty B

69 2013/BSIT/109 Faheem Harris Amanat Gulab Cheday 61 Sixty One B

70 2013/BSIT/110 Faheemullah Hazoor Bux Rajpur 42 Forty Two D

71 2013/BSIT/111 Ghulam Mustafa Ghulam Nabi Jamali 40 Forty D

72 2013/BSIT/114 Humera Ali Hassan Mangi 84 Eighty Four A

73 2013/BSIT/117 Jamil Ahmed Bahadur Khan Birmani 40 Forty D

74 2013/BSIT/118 Kamran Ali Azizullah Soomro 60 Sixty B

75 2013/BSIT/120 M. Umair Muhammad Kamil Shaikh 86 Eighty Six A

76 2013/BSIT/122 Masroor Ahmed Ghulam Shabir Janwery 70 Seventy B

77 2013/BSIT/123 Muhammad Akram Shahdad Ali 40 Forty D

78 2013/BSIT/124 Muhammad Arif Muhammad 40 Forty D

79 2013/BSIT/125 Muhammad Shariq 40 Forty D

80 2013/BSIT/126 Mushtaque Ali Mubarak Ali Thahim 83 Eighty Three A

81 2013/BSIT/127 Nafees Ali Mir Khan Thahim 80 Eighty A

82 2013/BSIT/128 Naveet Kumar Bhavanishanker 40 Forty D

83 2013/BSIT/129 Nawab Ali Rajab Ali Khaskheli 74 Seventy Four B

84 2013/BSIT/130 Omparkash Rattan Bajeer 71 Seventy One B

85 2013/BSIT/131 Rajesh Kumar Madan Lal Sonaro 74 Seventy Four B

86 2013/BSIT/132 Sadam Hussain Ghulam Qadir Jhandeer 60 Sixty B

87 2013/BSIT/133 Sadam Hussain Muhammad 40 Forty D

88 2013/BSIT/134 Saifullah Mian Bux Dahani 60 Sixty B

89 2013/BSIT/136 Salamat Ali Ali Akbar Soomro 60 Sixty B

90 2013/BSIT/138 Shabana Soomro Hamza Ali Soomro 86 Eighty Six A

91 2013/BSIT/139 Sufyan Ali Muhammad Younis Jat 72 Seventy Two B

92 2013/BSIT/141 Tajamal Masood Masood 92 Ninety Two A

93 2013/BSIT/142 Tousif Ali Sikandar Ali Solangi 86 Eighty Six A

94 2013/BSIT/143 Wakeel Ahmed Haji Mithal Korejo 61 Sixty One B

95 2013/BSIT/145 Zohaib Hussain Zahid Hussain Hakro 60 Sixty B

96 2013/BSIT/146 Muhammad Ibrahim Mushtaque 83 Eighty Three A

97 2013/BSIT/147 Bilawal Hussain Akhtiar Ali Soomro 80 Eighty A

98 2013/BSIT/148 Aazad Ali Talib Hussain Mahesar 60 Sixty B

99 2013/BSIT/149 Sadam Hussain Aitbar Ali Suhiryani 60 Sixty B

100 2013/BSIT/150 Muhammad Sharyar Sabir 62 Sixty Two B

101 2013/BSIT/152 Muhammad Yousuf Muhammad Siddiqui 60 Sixty B

102 2013/BSIT/155 Gul Muhammad Abdul Qadir Buriro 82 Eighty Two A

103 2013/BSIT/157 Mahmood Haji Waris Shahani 80 Eighty A


Total 103 Studens


 

Featured post

Addmision are open

  Offering Professional Courses in the field of  Multimedia, Animation and Graphics