Posts

Hollywood vs Bollywood - Scene Comparison

Image
Here are some shot comparison of similar scenes from Bollywood movie "Mohan Jodaro" and TV-series "Game of Thrones" I always want to pin point things that Bollywood movies lack in quality that Hollywood movies and TV-series have. It begins with some simple math that when input is better, there is a good chance that output will be better as well. Hollywood movies have big budgets, they can have better production quality and they can invest more in things like visual effects. Their target audience is slightly different, which I believe is changing. People all over world watch Hollywood movies and TV-series like Game of thrones which raises their expectation from Bollywood movies as well (Indian TV-series are not even in comparison - they are just bull shit). Bollywood typical formula of Muscle show-off, shaking of head while delivering dialogue, jumps that break all physics rules, cat walks will soon come to an end, they will have to give more to their audience....

Auto formatting Python code

Install Visual Studio Code. Once installed, open visual studio code. press "command + p", a window will open at the top. Type : ext install python Open terminal and type following commands : pip install pep8 pip install --upgrade autopep8 pip install pylint  Start auto formatting python code

DirectX3d - Graphics Rendering Pipeline

Image
From :  http://user.xmission.com/~legalize/book/preview/poster/index.html Another Resource : http://www.realtimerendering.com/#rendpipe

Maths and Graphics are fun

Image
CG - Maths http://acko.net/files/fullfrontal/fullfrontal/wdcode/online.html WebGL / Rendering techniques http://acko.net/files/fullfrontal/fullfrontal/webglmath/online.html

Maya and Mac os using different version of SVN

While writing some tools for Maya to perform SVN operations, I found that they were erring out. To investigate the problem I ran a simple test in Mac Terminal and Maya. Mac terminal : $  svn --version Output :  svn, version 1.8.13 (r1667537) Maya  : import subprocess command = "svn --version" process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,           stderr=subprocess.PIPE, universal_newlines=True) out, err = process.communicate() print out,err Output :  svn, version 1.7.10 (r1665045) Problem : Clearly my Mac Os and Maya were using different SVN. On executing command: "which svn" Terminal gave =  /usr/bin/svn Maya gave      = usr/local/bin/svn After spending allot of time, I was not able to figure out how to point maya to use usr/local/bin/softwares. I tried modifying - /etc/paths file (which is $PATH), - /Users/username/.bash_profile My Solution: 1. Install svn...

Calling an external command in Python

Here's a summary of the ways to call external programs and the advantages and disadvantages of each: os.system("some_command with args")  passes the command and arguments to your system's shell. This is nice because you can actually run multiple commands at once in this manner and set up pipes and input/output redirection. For example, os.system("some_command < input_file | another_command > output_file") However, while this is convenient, you have to manually handle the escaping of shell characters such as spaces, etc. On the other hand, this also lets you run commands which are simply shell commands and not actually external programs. see documentation stream = os.popen("some_command with args")  will do the same thing as  os.system  except that it gives you a file-like object that you can use to access standard input/output for that process. There are 3 other variants of popen that all handle the i/o slightly differently. If you pa...

Robomongo and MongoDB - initial setup on Mac

Image
1. Install MongoDB : Download tgz or zip file from MongoDB website   Extract tgz or zip file in home directory eg : /Users/userName/mongodb_x86_64-3.0.0 Add path of mongoDB directory in PATH 2. Run MongoDB server : Create a directory for primary DB path. /Users/userName/mongodb_x86_64-3.0.0/data/db Run Command /Users/userName/mongodb_x86_64-3.0.0/bin/mongod --dbpath /Users/userName/mongodb_x86_64-3.0.0/data/db  --bind_ip 0.0.0.0 -v 3. Install RoboMongo : Download RoboMongo from http://robomongo.org/ Drop downloaded/extracted folder in Applications folder (/Applications) 4. Run RoboMongo and Connect with MongoDB : 5. Create Example Database in RoboMongo : Step 1 : Create Database Step 2 : Create Collection ( Collection of Documents/Tables ) Step 3 : Create Document/Table  Step 4 : Insert data in Document Query Test in Python ( using pymongo) import pymongo # Connecting with server client = p...

Dictionary vs KeyValuePair vs Struct - C#

Dictionary :  //   Declare   Dictionary and assign value Dictionary < string ,  object >  parameter  =  new   Dictionary < string ,  object >(); parameter [ " View " ] =  viewComp ; parameter [ " Play " ] =  true ; FunctionName( parameter ); //   Use   Dictionary private   void   FunctionName ( object   parameter ) {      Dictionary < string ,  object >  dict  = ( Dictionary < string ,  object >) parameter ;      GameObject   viewComp  = ( GameObject ) dict  [ " View " ];      bool   play  = ( bool ) dict [ " Play " ];      UseValuesInFunction ( viewComp ,  play ); } KeyValuePair : KeyValuePair < GameObject ,  bool >  parameter  =  new   KeyValuePair < GameObject ,  bool >( viewComp ,...

PyDev with Eclipse on Mac

Image
Step 1 : Install Eclipse Step 2 : Install PyDev Here is the easiest way of drag-n-drop : http://marketplace.eclipse.org/content/pydev-python-ide-eclipse Step 3 : Configure Python Interpreter Path to MayaPy's python interpreter : /Applications/Autodesk/maya2014/Maya.app/Contents/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python Extras : 1. For Autocompletion, add following line in "Forced Builtins" : maya.cmds,maya.mel,maya.standalone,maya.app,maya.OpenMaya,maya.OpenMayaAnim,maya.OpenMayaCloth,maya.OpenMayaFX,maya.OpenMayaMPx,maya.OpenMayaRender,maya.OpenMayaUI which will add following libraries : maya.cmds maya.mel maya.standalone maya.app maya.OpenMaya maya.OpenMayaAnim maya.OpenMayaCloth maya.OpenMayaFX maya.OpenMayaMPx maya.OpenMayaRender maya.OpenMayaUI Another Resource :  http://sourceforge.net/p/pydev/discussion/293649/thread/fb1b2e45

How curves are drawn by your computer ?

Image
Cubic Bezier Curves - Under the Hood from Peter Nowell

Simple explanation of Physics based motion in games

http://www.richardlord.net/presentations/physics-for-flash-games http://www.richardlord.net/images/slides/physics2007.swf
Image
Unity Editor Scripting : If you ever have to create an instance (in hierarchy) from an .fbx file and a prefab from an instance, you can use following commands. 1 .fbx to instance      :  PrefabUtility . InstantiatePrefab 2 instance to .prefab :  PrefabUtility . CreatePrefab Creating AnimatorController file :  AssetDatabase . CreateAsset  

Conditional / Ternary Operator

Conditional Operator / Ternary Operator : condition ? true_expression : false_expression; bool x = condition ? true : false; eg : string   result  = (percentage  >= 36)  ?  "pass"  :  "fail" ; -------------------------------------------------------- NullCoalesce (??) int totalMarks = marks ?? 0 ; The  ??  operator is called the null-coalescing operator. It returns the left-hand operand if the operand is not null; otherwise it returns the right hand operand. eg:  int ? x = null ; int y = x ?? -1; int? is a shorthand for Nullable, which itself is shorthand of Nullable. eg Nullable a = null; A nullable type can represent the correct range of values for its underlying value type, plus a additional null value. --------------------------------------------------------

Installing Ant, Svn and Git on Mac

Install home-brew if not already installed ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" or ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" sudo brew update brew install ant brew install svn brew install git Install  JDK 7 ( If apache doesn't work in Sierra here is a usefull article : https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions)
           Great trick for optimization so that code doesn't have to count size of array/list again and again.    for  ( int   i  =  0 ,  count  =  objectList . Count ;  i  <  count ;  i ++)             {                 .......  =  objectList [ i ];                  if  ( .... )                 {                     ........                 }             }

Intro to Objective-C

Intro to Objective-C :  http://cocoadevcentral.com/d/learn_objectivec/

Unity - Pixel/Fragment Shader

Image
Shader   " Custom /SamplePixelShader "  {      Properties {          _Color  ( " Main   Color " ,  Color ) = ( 1 , 0 , 1 , 1 )          _MainTex  ( " Texture   RGBA " ,  2D ) =  " white "  {}          // _Alpha (" Alpha " , Range ( 0 , 1 )) =  0 . 5          // _SpecColor  (" Spec   Color ",  Color ) = ( 1 , 1 , 1 , 0 )          // _Emission  (" Emissive   Color ",  Color ) = ( 0 , 0 , 0 , 0 )          // _Shininess  (" Shininess ",  Range  ( 0 . 1 ,  1 )) =  0 . 7     }      Category {         ...