Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.71 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.71 KB

Bezier-curves-graphics

Made a flower using Bezier curves in C++ using OpenGL.

OpenGL (GLUT) on linux(ubuntu)

Installation

  • Install the following packages from the ubuntu repository:
  1. freeglut3-dev
  2. mesa-common-dev

Compiling and Linking

  1. You will have to use the -lglut linker option with gcc/g++ to compile a program with glut library.
  2. For example, to compile the program cube.c that uses GLUT type, use
  3. gcc -o cube cube.c -lglut -lGLU
  4. to get the binary executable cube.

If you are not using GLUT and want to use the lower level libraries then use -lGL -lGLU also in the linker options.

sudo apt-get install freeglut3 freeglut3-dev mesa-common-dev

Check your /usr/include/GL folder to verify the installation of the openGL headers that you intend to use.

OpenGL (GLUT) on Windows

Installation

  1. opengl32.lib
  2. glu32.lib
  3. gl.h
  4. glu.h
  • These are usually provided by the manufacturer of your display adapter. The following files will also be needed for using GLUT
  1. glut32.dll
  2. glut32.lib
  3. glut.h
  4. Download GLUT. Unzip and copy glut32.dll to C:\Windows\system32
  • Note:The code given works in ubuntu.To run it in Windows, add a header file #include<windows.h>

Steps to setup:

Clone the repository. git clone https://github.com/ishukhanchi/Bezier-curves-graphics.git

Open terminal and follow following commands:

  • Change directory to repository. cd Bezier-curves-graphics
  • Type g++ bz1.cpp -lglut -lGLU -lGL
  • Type ./a.out
  • Press "i" key on the keyboard to initiate the making of petals.
  • The output image will be:
    output image