Posts

Showing posts from 2013

Great modelling break down by Carlos

Sorting Algorithms in Python

 Python Sorting Algorithms and the time taken by each algorithm to sort values.  http://www.daniweb.com/software-development/python/code/216689/sorting-algorithms-in-python

Painted Textures

Another good one!

Web GL

I have recently started learning Web-GL. I found one Web-GL course on Udacity.com, here is the link: https://www.udacity.com/course/cs291 I found this course amazing not only from Web-GL point of view but it also gives you a good understanding of rendering-concepts. And while looking at different Web-GL examples, I found following link which has some great physics simulation examples. http://lonely-pixel.com  And this presentation gives you a good idea of different rendering styles : http://acko.net/files/fullfrontal/fullfrontal/webglmath/online.html

Wrapper functions

A very simple example for writing wrapper functions in Python. def polySphere(*args,**kwargs):     try:         return cmds.polySphere(*args,**kwargs)     except:         print "Could not create polySphere"         print sys.exc_info()  polySphere(r=5,sw=20,sh=20)

Bounding Box in PIL (Python Image Library)

Image
Bounding Box in PIL(Python Image Library) : Bounding Box function of PIL can be very useful for removing unused pixels from an image. Eg. If we want to remove unused pixels based on alpha channel of an image, we can use following code.   im = Image.open(imagePath) r,g,b,a = im.split() left,upper,right,lower = a.getbbox() tempImage = im.crop((left,upper,right,lower)) newPath = imagePath.split(".")[0]+"_Cropped" + "." + imagePath.split(".")[1] tempImage.save(newPath) To understand which values, getbbox() function returns and what do they look like on an image, I created an image showing the values returned by the function. left,upper,right,lower = image.getbbox()   Suppose you have a point in an original image and you want to find out the new position of the same point in the cropped image, lets see how we can do it. Suppose the point is at (300,450) position in an original image, so after cr

Some Regex Expressions

http://www.tutorialspoint.com/python/python_reg_expressions.htm

Nice Little Game Development Breakdown.

http://blogs.wsj.com/digits/2013/03/04/behind-the-making-of-a-mobile-game/

Dynamically Generating Curves

These are few lines of code to generate dynamic curves in Maya. I wrote this code while researching about effect of different trigonometrical function on a curve. import math,maya.cmds as cmds,maya.mel as mel points ="[" x= 0 for i in xrange(50):    x+=i    points = points + ("("+str(x)+","+ str(math.sin(i*10)*10) +",0),") points = points.rstrip(",")+"]" cmds.curve(p=eval(points))