Showing posts with label vtu mini project. Show all posts
Showing posts with label vtu mini project. Show all posts

Monday, 28 March 2016

Graphics Editor

Graphics Editor

‘A picture is worth a thousand words’ goes the ancient Chinese proverb. This has become a cliché in our society after the advent of inexpensive and simple techniques for producing pictures.
           
  Computers have become a powerful medium for the rapid and economical production of pictures. There is virtually no area in which graphical displays cannot be used to some advantage. Graphics provide a so natural means of communicating with a computer that they have become widespread. Interactive graphics is the most important means of producing pictures since the invention of photography and television.
       
   The general purpose graphics package provides users with variety of functions for creating and manipulating pictures. Interactivity is implemented by using buttons, which when clicked, using a pointing device such as a mouse, calls the specified function containing the algorithm.
        
 Graphics Editor is a software tool that helps the user to create some painting on the screen to do some operation on it. This is a simple and a user friendly graphics editor based on the Windows platform. It consists of the following basic facilities:
  • Geometrical shapes such as straight line, parallel lines, circle, ellipse, spiral, square and rectangle can be drawn.
  • Some other features include flood fill, eraser, free hand drawing and text typing.
  • A range of colors and patterns has been provided for the user to choose from.
The position of the mouse pointer is shown in the status bar at the bottom of the screen.   In short all the basic features necessary for the graphics editor have been provided. Care is taken to provide an easy-to-use mouse interface involving an icon-based interaction to provide an intuitive feel to our graphics editor. 


Screen Shots

This section gives us an overview of various functions that have been implemented and their respective representation on the output screen .The various functions are explained along with the illustration of using it is as shown below.

A basic output of the editor before implementing any of the tools and the function used to implement it is as shown below.



Snapshot of  Graphics Editor(Default Output screen).





Snapshot of Graphics editor(using various functions).


Download Program Source Code here
Download Full Project Report here

Tower Of Hanoi

Tower Of Hanoi

The development of this project would improve the user’s knowledge about computer graphics and OpenGL. This project provides good understanding of OpenGL prominent functions like Transformation, Rotation and Clipping, scaling.
             Keeping the factors of usability in mind we have develop this project to provide ease of use. This project will allow user to interact with it through the use of devices like keyboard or mouse.
            This is a project mainly concern with 3D graphics implementation.
Aim of the project:


  • Some time it is necessary to display those object which are
  • Our aim is to draw attention of users toward computer graphics
  • Our aim is to create dominant project which is simple in use 


    Screen Shots



    Disk shifting from one tower to other tower.




    Towers rotated upwards using ‘up’ navigation key.




    Towers rotated downwards using ‘down’ navigation key.




    Towers rotated anticlock wise using ‘right’ navigation key.




    Towers rotated clock wise using ‘left’ navigation key.




    Reset position of disks on 1st tower.


    Download Program Source Code here
    Download Full Project Report here

    Windmill

    Windmill

    In this project we designed the simulation of windmill using OpenGL. We used transformation functions like translate and rotate functions to design blades of the windmill. We used many OpenGL inbuilt function to design the structure of windmill.
    This project consist of many user defined function such as increasing windmill fan speed, decreasing windmill fan speed, side views, front and back views, custom angle of rotation of entire windmill structure.
    It provides several options which can be interacted through menus. The user can also interact with program through mouse, keyboard functions. The options provided by the menu are views like side view, back view, front view, custom view. Using mouse, if we click left side it rotates to left and on successive clicking speed increases, if we click right button speed decreases and on successive clicking, it turns rotating towards right and vice versa.
    We can rotate the entire windmill with respect to its axis using the arrow keys of keyboard. It can be rotate through 3600

    Simulation of Windmill is a designed and implemented using a graphics software system called OpenGL which has became a widely accepted standard for developing graphic application. Using openGL functions user can create geometrical objects and can use translation, rotation, scaling with respect to the co-ordinate system.

     The project Visual Transformation Techniques using openGL is based on Rotation and Translation processes using shading effects and is demonstrated using Visual C++.

                   The development of the Simulation of Windmill project has given us a good exposure to OpenGL by which we have learnt some of the technique which help in development of animated pictures, gaming. Hence it is helpful for us even to take up this field as our career too and develop some other features in OpenGL and provide as a token of contribution to the graphics world.

    Simulation of Windmill consist of many user defined function such as increasing windmill fan speed, decreasing windmill fan speed, side views, front and back views, custom angle of rotation of entire windmill structure. All these function makes this project an example of animation in OpenGL.  

    Screen Shots

    Screen displaying the menus



    The above diagram shows the snapshothaving options such as Data_Structuresand displaying the menu which consists of.:-
    • Side View 1
    • Side View 2
    • Back View
    • Front View
    • Custom View
    Back View



    The above diagram shows the snapshot about the option of Back View , in which the Back View of the Windmill structure is displayed .


    Side View 1




    The above diagram shows the snapshot about the option of Back View , in which the Side View of the Windmill structure is displayed


    Speed Tracking on Mouse Clicks


    The above diagram shows the snapshot about the simulation of the windmill, When the wheel of the windmill is made to rotate using the Left and Right Button of the mouse.
    When the Left Button of the mouse is clicked, it starts rotating and on further clicks the speed of the rotation increases.
    When the Right Button of the mouse is clicked, the rotation speed decreases and finally comes to halt.


    Free Movement using Keys




    The above diagram shows the snapshot about free movement of the Windmill structure using the keys. The Right Arrow key is used to rotate the angle of the windmill structure clockwise, whereas the Left Arrow Key is used to rotate the angle of windmill structure anti-clockwise.



    Initial screen


    The above diagram shows the snapshot having the windmill. The objects are of windmill shape and are placed towards the right of the display window. And the display window is of size (600,600). 

    Download Program Source Code here 
    Download Full Project Report here

    Steam Engine

    STEAM ENGINE

    A steam engine is a heat engine that performs mechanical work using steam as its working fluid. Heat is obtained from fuel burnt in a closed firebox .The heat is transferred to the water in a pressurized boiler, ultimately boiling the water and transforming it into saturated steam. Steam in its saturated state is always produced at the temperature of the boiling water, which in turn depends on the steam pressure on the water surface within the boiler. The steam is transferred to the motor unit which uses it to push on pistons to power machinery. The used, cooler, lower pressure steam is exhausted to atmosphere.
    The project simulates the working of a steam engine. It illustrates how the linear motion of the piston is converted into rotary motion. The engine is initially at rest. On right clicking, the user is provided with a menu which provides five options-shaded, animate, increase speed, decrease speed, transparent.
    The animate option starts the steam engine from rest or stops the engine if it is running. The speed of the engine can then be increased by the increase speed option or decreased by the decrease speed option. The texture of the engine can be changed by the shaded option.There are two textures. One being the normal solid fill and the other being wireframe. The transparent option makes the front portion of the cylinder transparent and shows the up and down motion of the piston.
    The simulation helps in understanding the working of the engine. It clearly shows how the linear motion is converted into rotary motion.

    Screen Shots


    Screenshot showing the initial shaded model of the engine



    Screen shot showing the wire frame model of the  engine which is in motion and being rotated about the Y-axis


    Download Program Source Code here
    Download Full Project Report here

    Introduction to OpenGL

    Introduction to Computer Graphics and OpenGL



    1.1     Introduction to Computer Graphics
    Computer Graphics is concerned with all aspects of producing pictures or images using a computer. We can create images that are indistinguishable from photographs of real objects. In other terms, Computer Graphics re the graphics created by the computers, and more generally, the representation and manipulation of image data by a computer.
    The development of computer graphics has been driven both by the needs of the user community and by advances in hardware and software.
    Typically, the term Computer Graphics refers to several different things.
    ·         The representation and manipulation of image data by a computer.
    ·         The various technologies used to create and manipulate images.
    ·         The images so produced, and manipulating visual content.

                            


    1.2     History of Computer Graphics

    The phrase Computer Graphics was coined in 1960 by William Fetter, a graphic designer for Boeing. The field of Computer Graphics developed with the emergence of computer graphics hardware. Early projects like the Whirlwind and SAGE projects introduced the CRT as a viable display and interaction interface and introduced the light pen as an input device.
    Further advances in computing led to greater advancements in interactive computer graphics. In 1959, the TX-2 computer was developed at MIT's Lincoln Laboratory. A light pen could be used to draw sketches on the computer using Ivan Sutherland’s revolutionary Sketchpad software.
    Also in 1961 another student at MIT, Steve Russell, created the first video game, Spacewar. E. E. Zajac, a scientist at Bell Telephone Laboratory (BTL), created a film called "Simulation of a two-giro gravity attitude control system" in 1963. In this computer generated film, Zajac showed how the attitude of a satellite could be altered as it orbits the Earth. Many of the most important early breakthroughs in computer graphics research occurred at the University of Utah in the 1970s.  
    The first major advance in 3D computer graphics was created at UU by these early pioneers, the hidden-surface algorithm. In order to draw a representation of a 3D object on the screen, the computer must determine which surfaces are "behind" the object from the viewer's perspective, and thus should be "hidden" when the computer creates (or renders) the image.
    Graphics and application processing were increasingly migrated to the intelligence in the workstation, rather than continuing to rely on central mainframe and mini-computers. 3D graphics became more popular in the 1990s in gaming, multimedia and animation. Computer graphics used in films and video games gradually began to be realistic to the point of entering the uncanny valley. Examples include the later Final Fantasy games and animated films like The Polar Express.

    1.3    Applications of Computer Graphics

              The development of computer graphics has been driven both by the needs of the user community and by advances in hardware and software. The applications of computer graphics are many and varied. We can however divide them into four major areas.
    ·         Display of information: More than 4000 years ago, the Babylonians developed floor plans of buildings on stones. Today, the same type of information is generated by architects using computers. Over the past 150 years, workers in the field of statistics have explored techniques for generating plots. Now, we have computer plotting packages. Supercomputers now allow researchers in many areas to solve previously intractable problems. Thus, Computer Graphics has innumerable applications.
    ·         Design:  Professions such as engineering and architecture are concerned with design. Today, the use of interactive graphical tools in CAD, in VLSI circuits, characters for animation have developed in a great way.
    ·         Simulation and animation: One of the most important uses has been in pilots’ training. Graphical flight simulators have proved to increase safety and reduce expenses. Simulators can be used for designing robots, plan it’s path, etc. Video games and animated movies can now be made with low expenses.
    ·         User interfaces: Our interaction with computers has become dominated by a visual paradigm. The users’ access to internet is through graphical network browsers. Thus Computer Graphics plays a major role in all fields.


    1.4    Introduction to OpenGL

    OpenGL is a software interface to graphics hardware. This interface consists of about 150 distinct commands that are used to specify the objects and operations needed to produce interactive three-dimensional applications. OpenGL is designed as a streamlined hardware-independent interface to be implemented on many different hardware platforms.
    These are certain characteristics of OpenGL:
    ü  OpenGL is a better documented API.
    ü  OpenGL is much easier to learn and program.
    ü  OpenGL has the best demonstrated 3D performance for any API.
                The OpenGL specification describes an abstract API for drawing 2D and 3D graphics. Although it's possible for the API to be implemented entirely in software, it's designed to be implemented mostly or entirely in hardware.
    In addition to being language-independent, OpenGL is also platform-independent. The specification says nothing on the subject of obtaining, and managing, an OpenGL context, leaving this as a detail of the underlying windowing system. For the same reason, OpenGL is purely concerned with rendering, providing no APIs related to input, audio, or windowing.
    OpenGL is an evolving API. New versions of the OpenGL specification are regularly released by the Khronos Group, each of which extends the API to support various new features.In addition to the features required by the core API, GPU vendors may provide additional functionality in the form of extensions. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions. Vendors can use extensions to expose custom APIs without needing support from other vendors or the Khronos Group as a whole, which greatly increases the flexibility of OpenGL. All extensions are collected in, and defined by, the OpenGL Registry.



    1.5    Introduction to GLUT

    GLUT  is the OpenGL utility toolkit, a window system independent toolkit for writing OpenGL programs. It implements a simple windowing API for OpenGL. GLUT makes it easier to learn about and explore OpenGL programming. GLUT provides a portable API so you can write a single OpenGL program that works across all PC and workstation OS platforms. GLUT is designed for constructing small to medium sized OpenGL programs.
    While GLUT is well-suited to learning OpenGL and developing simple OpenGL applications, GLUT is not a full-featured toolkit so large applications requiring sophisticated user interfaces are better off using native window system toolkits.The GLUT library has both C, C++ (same as C), FORTRAN, and ADA programming bindings. The GLUT source code distribution is portable to nearly all OpenGL implementations and platforms.


    1.6    Applications of OpenGL

    ü  OpenGL (Open Graphics Library) is a cross-language, multi-platform API for rendering 2D and 3D computer graphics.
    ü  The API is typically used to interact with a GPU, to achieve hardware-accelerated rendering.
    ü  It is widely used in CAD, virtual reality, scientific visualization, information visualization, flight simulation, and video games. 

    1.7     OpenGL primitives

                 OpenGL supports two classes of primitives:
    ·         Geometric Primitives
    ·         Image(Raster) Primitives
                 Geometric primitives are specified in the problem domain and include points, line segments, polygons, curves and surfaces.
                 Raster primitives, such as arrays of pixels pass through a separate parallel pipeline on their way to the frame buffer.



    3D Car - Animation

    3D Car - Animation

    This is a simple view of a car. It can be moved front and back using arrow keys. A road can be made to appear optionally.

    Screen Shots :

    With Road :


    Download Program Source Code here
    Download Report here

    Brick Breaker - A Game

    Brick Breaker - A Game

    This is another of my game which is very primitive and unfinished. Anyone interested to develop the game further is welcome.

    Here is how the UI looks like...


    As you can see after running the code the game is partially complete and there is no end. If you want to show this as your computer graphics project you are free but you need to complete it.
    This is a list of problems that need to be overcome.


    1. The bullets seem to pass through the bricks and the brick vanishes a little late. 
    2.  There are ten bullets used here and they are recycled. That is a bullet which passes through or which blasts a brick, its position is reinitialized to the muzzle of the shooter from where it is shot again. The problem is two bullets have a tendency to be shot together or close to each other. This looks so much uncool. We would want distance between bullets to be equal. 
    3. Even if a single brick comes near to the shooter region the game should end. I have deliberately left it unfinished. If you can write code to finish the game then it is a great thing. You can claim a little credit for having worked on this project. If you are able to solve the problems i mentioned earlier then you are a pro. If you manage to do so and if you are magnanimous enough you can get me the code and i will share it with everyone after giving you the credit.
    Download Program Source Code here
    Download Report here

    Leaping Lizards/ Dinosaur

    Leaping Lizards/ Dinosaur

    This is not a game. It is an animation to draw a dinosaur and move it. The entire scene can be rotated by using the mouse as a trackball over the window. Modification of this program may include moving the arm/tail or the mouth to indicate mastication.


    Here is how leaping lizards or dino looks like...





    Download Program Source Code here


    Download Report here

    Racer Game

    Racer Game

    In this project the cars are moving as earlier in the old racer car project posted before. Only extra thing that is added is that the black meter line on the road is made to translate down so that it gives an impression that the cars are moving.

    Here are a few snaps:



    The problem with this project is that after some points a few cars block the road and player compulsorily loses.



    Download Program Source Code here


    Download Report here

    Racing Car

    Racing Car

    As the name suggests this racing car is going on a racing track which glows...



    Will turn out as an excellent professional though i would like to advise him to slow down his typing speed while writing programs and devote more time to designing and analysis. I mean with paper and pencil before actually typing code. I know no programmer gets it right the first time but trial and error is not the right way to code.

    Needless to say i hate spaghetti code. Code which is not indented properly, Code which does not have comments. Code which has lots of debugging statements and code with lots of lines commented. Code with warnings while compiling and which runs anyway. Last thing that a programmer does after writing code which does the job is to beautify the code. Optimize the code. Make it look better. Write as many comments. Even if it’s just a hundred or two hundred line program it should be "delivered" properly even if its going to be an open source software.(NOTE: I FOLLOW NONE OF THE ABOVE. WHAT IS WRITTEN HERE IS CHARACTERISTICS OF AN IDEAL PROGRAMMER)

    Screen Shots:




    Download Program Source Code here
    Download Report here

    Sinking Ship

    Sinking Ship



    Namratha and sweekruthi worked on this existing project. The modification done to the sinking ship project that has been done is the ice berg becomes two pieces... both the pieces move down and sink.

    Here are the snaps:

    Moving....




    Collison... 




    Pieces of iceberg and ship sinking....




    Download Program Source Code here
    Download Report here