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 :)