Tuesday, July 21, 2015

Boolean Expression Evaluator : App by Karthik


This is an app by a friend, based on the Logic Lesson in Discrete Mathematics.

App Link

You can send your feedback and appreciation directly to him at : karthik_m_a_m@outlook.com

He develops apps under the name of Kappspot ( www.kappspot.yolasite.com )



Sunday, July 19, 2015

IP Lab : Java GUI based on Frames


I had a tough time searching google for this one.

Many sites talked about something called "Swing" for GUI Java Applications. It's some widget toolkit. Which is the new one, actually.

But Felix Mam was actually showing some codes in Internet, in class, and it was something different from what I saw about Swing. Then later, I realized, she showed the code based on AWT (Abstract Window Toolkit) which is an old one compared to Swing. Swing is some sophisticated thing it seems. That's what Google says.

I am gonna follow Mam and code using AWT stuff.

So, here's some basic material I found. I will post more when I find more. Even you could Google about AWT and AWT Events.

http://www.studytonight.com/java/java-awt.php

http://java-demos.blogspot.in/2012/10/close-awt-frame-in-java-using-windowlistener.html

http://java-demos.blogspot.in/2012/04/using-windowlistener-for-awt-frame.html

http://www.landofcode.com/java-tutorials/java-gui-layout.php

Saturday, July 18, 2015

Computer Graphics : Transformations


According to the lab exercise, we need to use homogeneous coordinates. That's a catch, since we need to use matrix and stuff for that.

I started out with the basic implementation, instead of the matrix stuff. Here's a code for the basic thing. You could build it up in a similar manner for the homogeneous coordinates implementation. I didn't do shearing and reflection :P

Code

PDF to learn the transformations :

PDF

Thursday, July 16, 2015

IP Tutorial Problems Solutions


These are some of the solutions for the tutorial problems.

I am uploading whatever I have and whatever I am coding.

Keep checking the link for solutions to other problems.

For updates, may be you could send me a mail to add you to the exclusive subscribers group.

Tutorial Problems and Solutions

Saturday, July 11, 2015

IP Lab Ex 3 : Socket Programming - UDP


Now, we gotta learn some basics in socket programming in Java. You could use internet and check out about it. I have a basic code over here, that I found in many sites :

Source Code

And in this code, they used BufferedReader Class Object and all, for obtaining the input from the user. You could actually use the one with the Scanner Class Object.

Rest of the code is kinda self explanatory, based on networking. And there is a while loop in the server code, just to show that the server is infinitely running and provides the service to many clients.

Friday, July 10, 2015

Computer Graphics : Target Board


Drawing the target board is a just very simple. You just need to code for circle, then draw concentric circles.



Computer Graphics : DDA Algorithm Implementation


Now this is revisiting for those who saw the old post or just saw the lab exercise Q, and tried something in DDA and got some output. For others, it's totally new and an easy road, since I am giving a part of the code. But seriously, I recommend you try something at least, before seeing my code, or else...it's like you telling yourself that you can't code it. So, have some self-respect.

DDA Code

It's just a part of the code. I was actually thinking to put up the simple math, using which I arrived at this implementation. Then I felt that you can do it yourself. Just in case you have problems with the math, the equations, the conditions and how they are justified, just mail me. I will explain it.

Besides, you might think DDA is just too simple and that these many posts might not be needed, remember, even these small things matter, if you can understand this, you can move forward to Bresenham with some confidence. It's all about math and understanding. And if you understand Bresenham, then Circle and Ellipse will follow one by one. It will be like a piece of cake. I will try putting up an explanation for all the equations.

Thursday, July 9, 2015

Having Bugs in CG Code ?


I see a lot of people having problems in CG codes.

In codes like DDA, especially when it comes to the different cases.

And some have problems in deriving stuff in Bresenham's line algorithm for cases other than positive m, m<1.

And take it from me, try not to look too much into the "Left to Right" and "Right to Left" thingy in the line algorithms...try to generalize that concept in your implementation, and it will consequently decrease the number of cases.

And try some math before coding and understand what's actually going on.

And you can always mail me your code, I will help you out ! :)

My mail id : karuppiah7890@gmail.com

Wednesday, July 8, 2015

IP Lab Ex 2 : Creating a Site

We were actually told to create site using many tags...very new ones too, like <svg> , <canvas>

I have no idea about them, some graphics stuff I heard. But no big deal, you could actually go to www.w3schools.com site and search any tag you want.

But then, use tags only if you need them. You don't have to use them just for the sake of using them.
Though I did use tags like <header> and <footer> just like that :P I know right, I am one to talk.

Now, from examination point of view, I don't think you need a looooot of creativity, may be you just need some. And some basic knowledge about websites, like how they look, and you should be done.
Rest all is about presentation, and appropriate usage of tags and I used even JavaScript, very basic stuff actually. I learnt it from w3schools site, actually you can learn from anywhere.

I learnt some "event handling" stuffs, like what happens when you click something, what happens when you roll over your mouse over something. It's really cool how your website can be dynamic. And I heard you can even do animations using JavaScript or even JQuery, which I mentioned in an earlier post.

There are lots of concepts out there, like " DOM Elements " and stuff, I don't know much about them, but you could take a look if you are interested. If you have been active in Paradigm work and have seen some seniors asking you to login to your facebook account to invite your friends using scripts, well....it's JavaScript (again JQuery can be used) and while writing those scripts, these DOM concepts will be really useful. They just run these scripts in the browser console (? Google it, I just did :P), to simulate a click on the "invite" button on the page.

There are really some cool stuff out there like these! Get a glimpse at it! We are Computer Science Engineers and we should know these!

My Website

It's not that good actually. And if you are gonna see it, I would like you to know that no ebook pdfs are attached :P and some video links are missing :P and if you click the "SSN" word on top, you go to home page. Well, I am saying because the cursor symbol doesn't change to a hand symbol (like for a link) when you roll over the "SSN" word on top :P

P.S : That's one big post! And if you read between lines or just came straight to "P.S"... no wonder ! :P

Saturday, July 4, 2015

Computer Graphics : Smiley Face :D


This smiley face was drawn using ellipse and circle. Looks cool, right ?;)

Probably I should try the " :P " smiley too :P it's my favorite :P


Computer Graphics : Midpoint Ellipse Algorithm


Again, just a matter of formulas, and then you can code this one easily. And it's more easier if you have already done midpoint circle algorithm.

Some Theory

Here's a glance at the output :



Friday, July 3, 2015

Computer Graphics : "WAX" word


Now that's a word drawn using lines, using bresenham's algorithm. I passed the end points of the lines as parameters for drawing the lines.

And yes, you need to code for negative slope too, in bresenham's algorithm, where |m| < 1 and |m| > 1. As you see, the left most line in the drawing of the letter 'W' has negative slope with |m| > 1, so it requires a code which can draw lines with negative slope. And so do many other lines in the above drawing. So, find equations for negative slope too and try to code accordingly.

By the way, I haven't used standing lines, since my word didn't need it, but if you are using standing lines, like for the stem in the letter 'T' , then you have to be careful, you see, in standing lines, the slope is not defined as

m = (y2 - y1)/(x2 - x1)

And in standing lines, x2 - x1 = 0, so m is not defined. So code properly for this situation and then the other cases are |m| < 1 and |m| >= 1.

Wednesday, July 1, 2015

Learn Programming App


It's a cheatsheet app. Cheatsheet is something which is used to refer to when you forgot what you learnt...but it is also a good way to grasp and learn things faster...at least things like HTML tags...Heard it's nice...and it has cheatsheets for many languages and even for linux basic commands

App Link

Computer Graphics : Bresenham's Midpoint Circle Algorithm


Theory for the algorithm

That's some good basic theory there, like how it is taught in class. For detailed theory, check your class notes :P ... I am sure the topic is taught.

And using this theory, you can code very easily based on the formulae.

And use the formula only to plot one octant of the circle. And then using mirror image logic - symmetry logic , you can find other pints for the other octants. See the above link.

Actually, I never knew about this octant stuff and mistook it as quadrant, since I didn't attend the class or check the above theory properly and you should see the output I got, based on 'quadrant' theory and symmetry plotting :


Now, that's some bad circle due to some crazy math which I am yet to check out (Care to help me ?)

So, use the octant theory and the actual output should look something like the below. And you can actually click the images to see them in full size. Don't mind the cross...I put it to check the accuracy and stuff...looks like a sniper view in a shooting game, doesn't it ? :P Mail me if you have problems understanding this theory :)