Tuesday, February 9, 2016

Elastic Collisions

Here are two links that will help you understand elastic collisions.
Link1      Link2
I am trying to get my program work properly but the balls refuse to behave well. Some of them pass through each other and some collide erratically.

Here is a gif of the snapshot:


This is a TurboC++ project working in Graphics.h library.
You can show this as your project with modifications to get the math right.
Here is the CPP file.

Monday, December 21, 2015

Mandelbrot and Julia set

Iterated function systems(IFS) can generate fractals. One such fractal is the mandelbrot set which is the iteration of seed points inside a unit circle. After many iterations if the point does not become large or go towards infinity then the seed point is colored with darker shade.
Here is a very great looking snapshot of the mandelbrot set generated with a program in my PC.

Here is the code which was used to generate this image. Note that this program is written in Turbo C++ with graphics.h library. The mouse cursor is hidden while the display is being drawn. After drawing the cursor appears and then you can click on any point in the set which generates a julia set. This Julia set is even more intriguing and i have the faintest idea what this is all about.
Here is a snapshot of the Julia set:
  

After generating this Julia set you can do palette animation and it can create headache for the viewers. Choas theory has seen tremendous progress and i read in pop sci books that it has lead to advancements in human knowledge.
This is a new post on the same bloody thing implemented in C using OpenGL and also some code from some blog in JOGL . https://cglabprojects.blogspot.in/2017/11/mandelbrot-and-julia-set-in-opengl.html

Wednesday, June 3, 2015

Traffic Lights

Poor students have to toil a lot to do these kind of projects and final outcome looks like how the chipmunks cleaned the house "spik and span".

They are bright, they are young and they are learning.

Credits go to shubham and mohd. ashfaq... since this project did not appear in the blog earlier and it looks new i presume that these guys did it on their own. Im still wondering how they did the clouds and the trees. Nice to know of such great talent in the college.

Snapshots:








Here is the source.

Space invaders

Jeevan hats off to you. Nice project and i really liked the attribution and warranty at the start of the program.

Here are the snapshots:






Here is the source.... scratchpad.c and textures.c.

Racing car

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

Abhilash Joel worked on this project and i must confess he is a good programmer. Will turn out as an excellent professional though i would like to advice him to devote more time to designing and analysis.

The last thing that a programmer does after writing code which does the job is to beautify the code. Online code beautification tools can be used. Optimize the code. Make it look better. Write as many comments. Even if its just a hundred or two hundred line program it should be "delivered" properly yes 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)

Snapshot:




Here is the source.

Abhilash forwarded me another version of the game which he claims is better in playing control. Here it is. Modifications that i suggest may be to change the color of the tracks and have a sky and greenery on the sides of the track.

Racer

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.

Here is the source.

Monday, April 27, 2015

Binary Search animation ported to ubuntu

 This project being done by one of my students is about binary search animation. Using quick sort the given array is sorted first. Then it is searched. There is a menu which appears on right click. If you don't mind the delay then this can be a good program to demonstrate binary search. This project was working in windows initially and with slight tweaks its now running in ubuntu.

Snapshots:







enter the value of n
5
enter the values
4 3 1 5 2

Enter the search value<-----2

press ENTER

------------GO TO THE WINDOW AND CLICK LEFT MOUSE BUTTON-------------

Here is the source.