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.


Friday, April 17, 2015

CGLABPROJECTS.BLOGSPOT.IN ---- Meta

Hi Guys,

If someone were to comment on the look and feel of my blog they would have many things to say, I hope. I begin all blog posts with "This project...." and my style of sharing code is to give a link to my Gdrive with "Here is the source..." and you are expected to magically know to try and click on here or source.
Blogs like these confuse first time visitors. The posts are in reverse chronological order.
Minor things apart, i must admit that if you have a look at the blog, there are quite a few projects in which i need to get GIF files generated to display the output. I purposefully chose GIF files because i know many of my students are browsing using limited data packs. I wanted to create videos of a few program's explanations. Just don't know how helpful it may be and also i feel it may cost me a few grand(absolutely penniless right now and eagerly awaiting the first 100 dollar cheque from google ads). My college professor advised me against giving out lecture videos for downloads fearing i may become more famous than the college in which i teach. In fact i was tasked with integrating moodle in our website. That is a work in progress and if we get a good hand we may pull it off, too. 

For the data that my blog consumes i feel it is worth the visit. For some of the students it may be a gateway to further learning. Some may be glad that they found my blog.

Today being a strike called for a dam being constructed by Karnataka in a border area south of Bangalore i was relatively free.

I hope my blog is a visual treat to the eye and sets your imagination on fire with computer generated imagery.

Here are some images from google to look at:

This is Funny:

This is a GIF of a fighting sequence:

Eye Candy along with fast cars:


These are the kind of graphic pacman monsters i would like in my games.... with eyes which turn and u can see the reflection,.... WOW!!!


How about window panes in metro trains as gaming screens???




Virtual Football....


Games for Kids between 5-10:


How do you handle failure while playing games??? The key is not to get angry and frustrated.


Thursday, April 16, 2015

Visual Sorting Algorithm

This project is under development by Prateek G. The code developed is for a crude sorting algorithm and it uses timer function as a re-entrant function.
Enhancements to be done include running this program for various sorting algorithms. I will surely post code to implement all the sorting algorithms in case I become jobless. Right now i can only suggest you these things. Prateek tried and failed i guess, and since he is a good student i presume there are practical difficulties in doing this.
Here is the snapshot:



Here is the source.

Monday, April 13, 2015

Running out of ideas.... for CG Lab Project of VTU - Implementation for New Ideas

So many students have ideas of project but are unable to implement since they cannot begin. Its the starting problem. Some start and face difficulty and then quit in the middle. Only a few are able to complete a project that too within the given semester end.


So here is an offer....

Post your project idea as a comment on this blog post and i will develop initial code which you can further enhance.

Monday, April 6, 2015

Ping Pong Balls - A Game

This is a game under development. One ping pong ball to start with just moves around the screen and collides with the walls. There is a tile at the bottom controlled by the mouse and when the tile is right below the ball it bounces. If there is no tile the ball should fall down and lives get decremented(supposed to but it does not do that as yet). This is left as an exercise. One more thing is the program has been created to have multiple ping pong balls each with different colors. This is as assignment. Show this as your CG lab project but after making it work. The worst part of this game is the ping pong ball moves in a fixed path. You need to modify it to move in different directions.

Snapshots till now:



Here is the source.... pp.c and scanconvertcircle.c
The speciality of this game is that i have modified code to scan convert a circle into filling the circle using scan line area filling. It is simple modification and i took only two hours to develop this game.

Here is another version of the same game in Java OpenGL.

Sunday, March 15, 2015

Rolling stone - A Game

"A Rolling Stone gathers no Moss"

This project is under development by one of my students raghava. I am posting some initial code which will be further modified by him and taken forward.

A stone keeps falling from the top and there are several slabs which help raise it. The goal of the game is to play as ling as possible.

Here is a snapshot:
As you can see it is rudimentary and there is no stone drawn as yet. Hope to make several modifications soon to make it a real game.

Here is the code developed till now which is 111 lines of code. There are several problems in it.

Friday, February 27, 2015

Tiles Exchange like Candy Crush

This is a simple program to exchange tiles. Here the use has to click on a tile drag the mouse and release the mouse in the nearby tile(horizontally or vertically). The colors of the tiles gets exchanged.
Here is a snap shot of the program.
It started out as a mesh program and i modified it to have different colors for the tiles. If you want further modification say vary dx,dy,maxx,maxy and choose a texture on the tiles.... as soon as the tiles exchanged form the correct image the game should end. The effort spent in making this game is less than three hours.
Ping me on google chat if you want the source. Will give to anyone interested(123 lines of code). By may end will give out the source on the blog for anyone to download.
Change of mind...====> Here <====is the code for the above project.

I have now found time to develop the project a bit further. I have succeeded in allotting colours such that not more than two squares have the same colour. After that when we exchange the tiles so that three same coloured tiles are in a line they vanish and white space created gets filled by movement of tiles above downwards.
Next i want to implement new tiles created at the top to fill the ones left empty. For now this is what i have done. There are some problems still to be ironed out. It is worthless to mention them here at this point. So download the game from ====> here <====and try to tinker with it.

Wednesday, January 28, 2015

Animating a GIF made using GIMP

I just don't have words to describe my happiness at having made a gif animation. I am posting the gif file here. Would soon make gif files out of all the graphics projects that i have created as of now.




I made this gif using the tutorial here.

The following is a gif made out of a jpeg compression software. The quality of the compression is varied and you get different results. The compression software from the independent JPEG group that i used is freely downloadable from here.



While i have been dying to get hold of the source code of JPEG and MPEG codecs i have not made much headway into writing image processing code or understanding them. Much of the slow progress is due to my reluctance to use MATLAB and partly result of my predominant policy of C only. I looked at ffmpeg and have it in my system. Just didn't find time to go through it. Most of the code i know will be greek and latin. I have handled Data Compression for one semester and the results were disastrous. Nearly 25% failed. I gave up on the subject and the students are now playing safe with taking OR(operations research in the sixth semester).

Recently students came to me with a project proposal of using OpenCV. I was impressed. It is open source. Again just cannot work my ass off(WMAO) to learn them.