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.