Tuesday, June 23, 2009

Simple things like find

http://www.softpanorama.org/Tools/Find/find_mini_tutorial.shtml

Unix find is a pretty tricky but very useful utility that can often fool even experienced UNIX professionals with ten on more years of sysadmins work under the belt. It can enhance functionality of those Unix utilities that does not include tree traversal (BTW GNU grep has -r option for this purpose and can be used on its own to perform tree traversal task: grep -r "search string" /tmp.). There are several versions of find with the main two being POSIX find used in Solaris, AIX, etc and GNU find used in linux. GNU find can be installed on Solaris and AIX and it is actually a strong recommendation as there are some differences; moreover gnu find have additional capabilities that are often useful.

But find can do more then a simple tree traversal available with option -r (or -R) in many Unix utilities. Traversal provided by find can have excluded directory tree branches, can select files or directories using regular expressions, can be limited to specific typed of filesystem, etc. This capability is far above and beyond regular tree traversal of Unix utilities so find is a real Unix utility -- a useful enhancer of functionally of other utilities including both utilities that do not have capability to traverse the directory tree and those which have built-in simple recursive tree traversal

The idea behind find is extremely simple: this is a utility for searching files using the directory information and in this sense it is similar to ls. But it is more powerful then ls as it can provide " a ride" for other utilities and has an idiosyncratic mini-language for specifying queries, the language which probably outlived its usefulness but nobody has courage to replace it with a standard scripting language.

For obscure historical reasons find mini-language is completely different from all other UNIX commands: it has full-word options rather than single-letter options. For example, instead of a typical Unix-style option -f to match filenames (like in tar -xvf mytar.tar) find uses option -name. Also path to search can consist of multiple starting points, for example

find /usr /bin /sbin /opt -name sar # here we exclude non-relevant directories

In general you need to specify the set of starting points for a search through the file system first. The first argument starting with "-" is considered to be a start of "find expression". The latter can have side effects if you specified actions in the expression.

It is very important to understand that you can specify more than one directory as a starting point for the search. To look across the /bin and /var/html directory trees for filenames that contain the pattern *.htm*, you can use the following command:

find /usr /var/html -name "*.htm*" -print

Please note that you need quotes for any regex. Otherwise it will be evaluated immediately in the current context by shell.

It is simply impossible to remember all the details of this language unless you construct complex queries each day and that's why this page was created. Along with this page it make sense to consult the list of typical (and not so typical) examples which can be found in in Examples page on this site as well as in the links listed in Webliography. An excellent paper Advanced techniques for using the UNIX find command was written by Bill Zimmerly. I highly recommend to read it and then print and have a reference. Several examples in this tutorial are borrowed from the article.

The full find language is pretty complex and consist of several dozens of different predicates and options. There are two versions of this language: one implemented in POSIX find and the second implemented in GNU find which is a superset of POSIX find. That can make big difference in complex scripts. But for interactive use the differences is minor: only small subset of options is typically used on day-to-day basis by system administrators. Among them:

  • -name True if pattern matches the current file name. Simple regex (shell regex) may be used. A backslash (\) is used as an escape character within the pattern. The pattern should be escaped or quoted. If you need to include parts of the path in the pattern in GNU find you should use predicate wholename

    Use the -iname predicate (GNU find supports it) to run a case-insensitive search, rather than just -name. For example:

     $ find . -follow -iname '*.htm' -print0 | xargs -i -0 mv '{}' ~/webhome

    Usage of -print0 is a simple insurance for the correct processing of files with spaces.

  • -fstype type True if the filesystem to which the file belongs is of type type. For example on Solaris mounted local filesystems have type ufs (Solaris 10 added zfs). For AIX local filesystem is jfs or jfs2 (journalled file system). If you want to traverse NFS filesystems you can use nfs (network file system). If you want to avoid traversing network and special filesystems you should use predicate local and in certain circumstances mount
  • "-atime/-ctime/-mtime" [+|-]n
    Specify selection of the files based on three Unix timestamps: the last time a files's "access time", "file status" and "modification time".
    n
    is time interval -- an integer with optional sign. It is measured in 24-hour periods (days) or minutes counted from the current moment.
    • n: If the integer n does not have sign this means exactly n 24-hour periods (days) ago, 0 means today.
    • +n: if it has plus sing, then it means "more then n 24-hour periods (days) ago", or older then n,
    • -n: if it has the minus sign, then it means less than n 24-hour periods (days) ago (-n), or younger then n. It's evident that -1, and 0 are the same and both means "today".

    Note: If you use parameters with find command in scripts be careful when -mtime parameter is equal zero. Some (earlier) versions of GNU find incorrectly interpret the following expression

    find -mtime +0 -mtime -1
    which should be equivalent to
    find  -mtime -1
    but does not produce any files
    • n: If the integer n does not have sign this means exactly n 24-hour periods (days) ago, 0 means today.
    • +n: if it has plus sing, then it means "more then n 24-hour periods (days) ago", or older then n,
    • -n: if it has the minus sign, then it means less than n 24-hour periods (days) ago (-n), or younger then n. It's evident that -1 and 0 are the same and both means "today".
    • Examples:
      • Find everything in your home directory modified in the last 24 hours:
        • find $HOME -mtime -1
      • Find everything in your home directory modified in the last seven 24-hour periods (days):
        • find $HOME -mtime -7
      • Find everything in your home directory that have NOT been modified in the last year:
        • find $HOME -mtime +365
      • To find html files that have been modified in the last seven 24-hour periods (days), I can use -mtime with the argument -7 (include the hyphen):
        find . -mtime -7 -name "*.html" -print

        If you use the number 7 (without a hyphen), find will match only html files that were modified exactly seven 24-hour periods (days) ago:

        find . -mtime 7 -name "*.html" -print
      • To find those html files that I haven't touched for at least seven 24-hour periods (days), I use +7:
        find . -mtime +7 -name "*.html" -print
  • -newer/-anewer/-cnewer baseline_file The time of modification, access time or creation time are compared with the same timestamp in the baseline file. If file is a symbolic link and the -H option or the -L option is in effect, the modification time of the file it points to is always used.
    • -newer Modification time is compared with modification time of the basline_file True if file was modified more recently than baseline file.
    • -anewer Access time is compared with access time of basline_file . True if file was last accessed more recently than baseline file.
    • -cnewer Creation file is compared. For example: find everything in your home that has been modified more recently than "~joeuser/lastbatch.txt ":
      • find $HOME -newer ~joeuser/lastbatch.txt
  • -local True if the file system type is not a remote file system type. In Solaris those types are defined in the /etc/dfs/fstypes file. nfs is used as the default remote filesystem type if the /etc/dfs/fstypes file is not present. The -local option skips the hierarchy of non-local directories. You can also search without descending more then certain number of levels as explained later or exclude some directories from the search using
  • -mount Always true. Restricts the search to the file system containing the directory specified. Does not list mount points to other file systems.
  • -xdev Same as the -mount primary. Always evaluates to the value True. Prevents the find command from traversing a file system different from the one specified by the Path parameter.
  • -xattr True if the file has extended attributes.
  • -wholename simple-regex [GNU find only] . File name matches simple regular expression (often called shell patterns). In simple regular expressions the metacharacters '/' and '.' do not exist; so, for example, you can specify:
    find . -wholename '/lib*'
    which will print entries from directories /lib64 and /lib. To ignore the directories specified, use option -prune For example, to skip the directory /proc and all files and directories under it (which is important for linux as otherwise errors are produced you can something like this:
    find . -wholename '/proc' -prune -o -name file_to_be_found   
    If you administer a lot of linux boxes it is better to create alias ff:
    if [[ `uname` == "Linux" ]] ; do

    alias ff='find . -wholename '/proc' -prune -o -name '

    else

    ff='find . -name ' # not GNU find does not support -wholename

    fi

Other useful options of the find command include:

  1. -regex regex [GNU find only] File name matches regular expression. This is a match on the whole pathname not a filename. Stupidly enough the default regular expressions understood by find are Emacs Regular Expressions, not Perl regular expressions. It is important to note that "-iregex" option provide capability to ignore case.
  2. -perm permissions Locates files with certain permission settings. Often used for finding world-writable files or SUID files. See below
  3. -user Locates files that have specified ownership. Option -nouser locates files without ownership. For such files no user in /etc/passwd corresponds to file's numeric user ID (UID). such files are often created when tar of sip archive is transferred from other server on which the account probably exists under a different UID)
  4. -group Locates files that are owned by specified group. Option -nogroup means that no group corresponds to file's numeric group ID (GID) of the file
  5. -size Locates files with specified size. -size attribute lets you specify how big the files should be to match. You can specify your size in kilobytes and optionally also use + or - to specify size greater than or less than specified argument. For example:
    find /home -name "*.txt" -size 100k 
    find /home -name "*.txt" -size +100k 
    find /home -name "*.txt" -size -100k 

    The first brings up files of exactly 100KB, the second only files greater than 100KB, and the last only files less than 100KB.

  6. -ls list current file in `ls -dils' format on standard output.
  7. -type Locates a certain type of file. The most typical options for -type are as following:
    • d -Directory
    • f - File
    • l - Link

    For example to find a list of the directories use can use the -type specifier. Here's one example:

    find . -type d -print

Tuesday, June 2, 2009

Oooooh.... Beautiful....

I fell into this site by chance: http://kaba.hilvi.org/
And I am ok impressed.

But the links....

cgafaq wiki

The plethora of source codes.... Oh.... I am going to pee in my pants...

http://www.geometrictools.com/index.html

Seriously... I mean pee like a broken damnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.

And look at the resources link provided:

http://www.geometrictools.com/Resources/Links.html

OpenGL: glLineWidth

//set line width
glLineWidth(20.0f);

glBegin(GL_LINES);

//draw vertices
glVertex3f (-10f, -10.0f, -10.0f);
glVertex3f (10f, 10.0f, 10.0f);

....

glEnd();


Note that not all hardware supports a line width of 20. To find out the supported range and line width increments call:

float sizes, increment;

glGetFloatv(GL_LINE_WIDTH_RANGE, sizes)
glGetFloatv(GL_LINE_WIDTH_GRANULARITY, &increment)

Modules selection

Ok, I've decided. This is the way I am going to pace my modules for Year 2.

Next Sem: Y2 S1
Computer Animation and Simulation
3D Modelling and Reconstruction

Y2 S2
Human Computer Interaction
Scientific Visualization

Y2 S3
Introduction to Games Design
BI6129 Directed Reading


I am actually quite excited for school. Hehe.

Monday, June 1, 2009

YAY! I Passed~~

You look drunk.
Yes, I am drunk. On happiness.
No, you really look drunk.
Oh yes. I am going to write a one hit wonder. And get so rich on it, I don't need to work. Oh yes... That sounds perfect.
Stop eating the gummy. You're getting a sugar high.

Thursday, May 21, 2009

Vista TWEAKS

Without much emotional attachment, I am now on Vista. The good thing is, most softwares install on this OS. Bad? I am still getting around the flow of it. But gosh... talk about fancifully slow.

So here are some guides on tweaking and optimising which I cannot guarantee works.

At least my batch scripts still works here. Hehe. Cool...


http://www.tweakhound.com/vista/tweakguide/page_2.htm

http://www.iamshadowlord.com/2007/06/windows-vista-optimization.html



Getting rid of that annoying activeX popup in Alex, under "Removing the Internet Explorer Toolbar Alert":

http://www.databoysoftware.com/allow.html

Sunday, April 12, 2009

Music to listen to while you're studying

And perhaps the neighbours are noisy and you needed to cancel them out, or you just don't want to fall asleep.

How to categorise that?
1. Not too slow or soft or soothing that you might fall asleep.
2. Nothing and I mean nothing that can distract you, (so you should not listen to any songs in languages that you understand or can sing along to).

These are the choices given by some people:

1. Brian Eno - Music for Airports

2. Boards of Canada -- > ooh I've been meaning to get their music.

3. Sigur Ros - They make me trip. I can't use this for studying.

4. Chicane - Ooh nice... must get their music.

5. Kaskade - Nice nice... Must get them too!!

6. Cirque du Soleil - oooooo?



Someone suggested these:
  • Sigur Rós - any of their albums are great, especially their b-sides/EPs
  • Mogwai
  • Boards of Canada as mentioned
  • Haibane Renmei - "Hanenone" - excellent soundtrack to an excellent anime
  • Any of the Final Fantasy Piano Collections (well, except IV and V, they're pretty unimaginative)
  • Film scores (particular favorites of mine are "Final Fantasy: The Spirits Within," "Crouching Tiger, Hidden Dragon," "Hero," "American Beauty," and "Crash")
I must say, Mac users are way cooler.... Their suggestions are good!! http://forums.macrumors.com/showthread.php?t=249125



http://www.amazon.com/Music-Listen-While-Youre-Studying/lm/CTMB4VPEAPU9


http://www.amazon.com/Trippy-chill-stoner-music/lm/1VQIBDTM9AQMU

My personal all time favourite has to be JAM and Yuki Isoya (solo effort), Shiina Ringo (given to me by accident). When I hear JAM, I just want to start Xcode or pick up my notes.

Animation: Classical Framework

In the classical animation framework, they're 4 models; 2 stimulus and 2 response.

Stimulus
1. Environment Model: Animation's environment where static and dynamic objects are created. Includes modeling and rendering.

2. Perception Model: Techniques of "perception" by the characters. Information detected by the character's sensory capabilities.
i. zonal approach
ii. sensory approach
iii. synthetic vision approach.

Response
3. Behavioural Model: Behavioural techniques provide the characters with ability to autonomous activity with its own decision. This can either be reactive or driven by internal desire/experiences (not so much Artificial Intelligence, but more Artificial Life....? )
i. Rule-based approach
ii. Network approach
iii. Artificial Intelligence approach
iv. Mathematical approach

4. Motor Model: Movement techniques - to move & animate the characters. Not related to planning of movement, that is done in behavioural model.
i. Basic dynamic approach
ii. Procedural approach


More references:
http://www.red3d.com/cwr/boids/

Wednesday, April 8, 2009

Friday, March 27, 2009

A historical timeline for Computer Graphics & Animation

http://sophia.javeriana.edu.co/~ochavarr/computer_graphics_history/historia/

Matrix Vector hints

Matric and various vector math hints and tips.
-------------------------------------------------------------------------------
General Matrix calculation is by

[x,y,z] * M => [x',y',z']

|x| |x'|
or M * |y| => |y'|
|z| |z'|

The result is the same in either case. As long as the matrix was created using
row vectors OR column vectors to match!

Which style is used is up to the matrix library version you use. I prefer
the former, which The perl Math::MatrixReal library seems to like the later.
Just note the order.


-------------------------------------------------------------------------------
Matrix and what the terms actually mean...

From the povray matrix page..
http://enphilistor.users4.50megs.com/matrix.htm

Generally a matrix is defined (at least in Povray) as...

| A.x A.y A.z 0 |
| B.x B.y B.z 0 |
| C.x C.y C.z 0 |
| D.x D.y D.z 1 |

This can be thought of a a matrix of four (row) vectors A, B, C, D
where A = | A.x, A.y, A.z, 0 | etc. (NB: A.x is the x component of A)

What this matrix does is wrap the 3D space so that the X axis moves (rotates,
scales, shear, etc) to vector A, ditto for Y -> B and Z -> C. The last vector
D is the new location for the Origin (translate).

As the page above specifies this means that if you create a set of orthogonal
vectors A,B,C general rotations are very easy to do, and goes on to provide a
two part solution to rotating any general vector to any other general vector
(while retaining an general up direction).

-------------------------------------------------------------------------------
Orthogonal Matrices

A matrix is orthogonal if each of the three vectors making up the matrix
are orthogonal. That is they are all perpenducular to each other.

This is true of all rotation matrices (no scaling or shear).

What is interesting is that the inverse of such matrices is also its
transpose. And that matrix in itself is also orthogonal.

This means if we have a rotation matix

| A.x A.y A.z |
| B.x B.y B.z |
| C.x C.y C.z |

To rotate the x,y,z axises to the A,B,C vectors, then it so happens that
the inverse (rotate A,B,C vectors to the x,y,z axises) is the matrixes
transpose (diagonal mirror).

| A.x B.x C.x |
| A.y B.y C.y |
| A.z B.z C.z |

-------------------------------------------------------------------------------
Rotation Matrices are...

Normilized or Each row or column are unit vectors (vector length = 1)
Orthogonal or Dot product of any row to to any other row
or column to column is 0
EG: All row or column vectors are perpendicular to each other
Its Inverse is also its Transpose (due to orthogonality)

-------------------------------------------------------------------------------
Rotation Matrix about axis (x,y,z) and angle a

Given that s = sin(a) c = cos(a) t = (1 - cos(a))
and x, y, z defines the axis you want to rotate around
then, the rotation matrix is...

| txx+c txy+sz txz-sy |
R = | txy-sz tyy+c tyz+sx |
| txz+sy tyz-sx tzz+c |

For very small angles (and you later occasionally re-normalize)
A technique often used for interactive rotations using a mouse.
Then s = sin(a) => a c = cos(a) => 1 t => 0
and thus rotation becomes
| 1 za -ya |
R = | -za 1 xa |
| ya -xa 1 |

Given a orthogonal rotation matrix
Then the axis and angle of rotation can be found using...

cos(a) = ( R[0][0] + R[1][1] + R[2][2] - 1 ) / 2

axis = ( R[1][2]-R[2][1], R[2][0]-R[0][2], R[0][1]-R[1][0] ) / 2*sin(a)

-------------------------------------------------------------------------------
General Rotatation of a unit vector V to unit vector W
(rotation in same plain as both vectors - ie: the minimal rotation)

This is complex and difficult if you try to generate it using the
above general axis and angle method. The following generates it faster
and more simply, without need for sin() and cosin() functions, using the
meaning of the three vectors in a roatation matrix.

To do this requires three steps...

1/ Matrix to rotate the Vector V onto some arbatary axis (eg: X)
but such that the vector W also rotates to W' in the XY plan!
2/ One to rotate about the Z axis so that the rotated vector V'
(which is now at the X axis) is rotated to W' in that frame work.
3/ Rotate back to the original axis frame work by using the
inverse (transpose) of the original rotation.

First Step
It is easier to calculate the last step and invert the matrix, so...

We need to find two more unit vectors orthogonal to the original
vector V. One of these vectors must be the axis of rotation
so it can be moved to the Z axis for the second step.

Find the axis of rotation N
N = normalised ( V x W )
And the other orthogonal axis to complete the axis frame work.
M = N x V (note M is unit length as N and V are orthoginal)
alturnativally...
M = normailzed( V x W x V )

to rotate the X Y Z axis to this frame work would thus be...
| Vx, Vy, Vz |
Q = | Mx, My, Mz | (NB: a matrix of row vectors)
| Nx, Ny, Nz |
But for this step we want to do the oppisite! So inverse the orthogonal
matrix by transposing (diagonal flip). So the first step is....
transpose(Q)

Second Step
The new location of V (or V') which is now the X axis, needs to be rotated
around Z (now the axis of rotation), to the new location of W or W'

W' = W * transpose(Q)

As the Z axis does not rotate we only need the new location of the Y
axis in this step to complete this step.

Y' = W' Zrotate(90deg)
= Z x W'

The actual rotaton matrix in this axis framework is thus...
| W'x, W'y, W'z |
T = | Y'x, Y'y, Y'z |
| Zx, Zy, Zz | <- This is just (0, 0, 1)

Third Step
We just rotate back to the original coordinate system...
This was the original matrix Q calculated in step one.


The completed rotation matrix is thus..

Rotate_V_to_W = R = transpose(Q) * T * Q


===============================================================================

The following is vector stuff, not matrix...

-------------------------------------------------------------------------------
Distance of a point to a line.

Given line AB, Point C some distance away.
Minimim distance of C to line (perpendicular to line)

r = (AB . AC) / |AB|^2

WRONG: that is the distance of C from A in the direction of A to B!
That is length along the line!

-------------------------------------------------------------------------------


From http://www.cit.gu.edu.au/~anthony/info/graphics/matrix_vector.hints

Thursday, March 26, 2009

Some info on Matrix & Quaternion... need to consolidate with the other posts

http://www.j3d.org/matrix_faq/matrfaq_latest.html

Perl RegEx reference

Conventions

The following conventions are used in the examples.

   metacharacter(s) ;; the metacharacters column specifies the regex syntax being demonstrated
=~ m// ;; indicates a regex match operation in perl
=~ s/// ;; indicates a regex substitution operation in perl

Also worth noting is that these regular expressions are all Perl-like syntax. Standard POSIX regular expressions are different.

[edit] Examples

Unless otherwise indicated, the following examples conform to the Perl programming language, release 5.8.8, January 31, 2006. The syntax and conventions used in these examples coincide with that of other programming environments as well (e.g., see Java in a Nutshell - Page 213, Python Scripting for Computational Science - Page 320, Programming PHP - Page 106 ).

Metacharacter(s) Description Example
Note that all the if statements return a TRUE value
. Normally matches any character except a newline. Within square brackets the dot is literal.
$string1 = "Hello World\n";
if ($string1 =~ m/...../) {
print "$string1 has length >= 5\n";
}
( ) Groups a series of pattern elements to a single element. When you match a pattern within parentheses, you can use any of $1, $2, ... later to refer to the previously matched pattern.
$string1 = "Hello World\n";
if ($string1 =~ m/(H..).(o..)/) {
print "We matched '$1' and '$2'\n";
}

Output:

We matched 'Hel' and 'o W';

+ Matches the preceding pattern element one or more times.
$string1 = "Hello World\n";
if ($string1 =~ m/l+/) {
print "There are one or more consecutive letter \"l\"'s in $string1\n";
}
Output:

There are one or more consecutive letter "l"'s in Hello World

? Matches the preceding pattern element zero or one times.
$string1 = "Hello World\n";
if ($string1 =~ m/H.?e/) {
print "There is an 'H' and a 'e' separated by ";
print "0-1 characters (Ex: He Hoe)\n";
}
? Modifies the *, +, or {M,N}'d regexp that comes before to match as few times as possible.
$string1 = "Hello World\n";
if ($string1 =~ m/(l.+?o)/) {
print "The non-greedy match with 'l' followed by one or ";
print "more characters is 'llo' rather than 'llo wo'.\n";
}
* Matches the preceding pattern element zero or more times.
$string1 = "Hello World\n";
if ($string1 =~ m/el*o/) {
print "There is an 'e' followed by zero to many ";
print "'l' followed by 'o' (eo, elo, ello, elllo)\n";
}
{M,N} Denotes the minimum M and the maximum N match count.
$string1 = "Hello World\n";
if ($string1 =~ m/l{1,2}/) {
print "There exists a substring with at least 1 ";
print "and at most 2 l's in $string1\n";
}
[...] Denotes a set of possible character matches.
$string1 = "Hello World\n";
if ($string1 =~ m/[aeiou]+/) {
print "$string1 contains one or more vowels.\n";
}
| Separates alternate possibilities.
$string1 = "Hello World\n";
if ($string1 =~ m/(Hello|Hi|Pogo)/) {
print "At least one of Hello, Hi, or Pogo is ";
print "contained in $string1.\n";
}
\b Matches a word boundary.
$string1 = "Hello World\n";
if ($string1 =~ m/llo\b/) {
print "There is a word that ends with 'llo'\n";
} else {
print "There are no words that end with 'llo'\n";
}
\w Matches an alphanumeric character, including "_".
$string1 = "Hello World\n";
if ($string1 =~ m/\w/) {
print "There is at least one alphanumeric ";
print "character in $string1 (A-Z, a-z, 0-9, _)\n";
}
\W Matches a non-alphanumeric character, excluding "_".
$string1 = "Hello World\n";
if ($string1 =~ m/\W/) {
print "The space between Hello and ";
print "World is not alphanumeric\n";
}
\s Matches a whitespace character (space, tab, newline, form feed)
$string1 = "Hello World\n";
if ($string1 =~ m/\s.*\s/) {
print "There are TWO whitespace characters, which may";
print " be separated by other characters, in $string1";
}
\S Matches anything BUT a whitespace.
$string1 = "Hello World\n";
if ($string1 =~ m/\S.*\S/) {
print "There are TWO non-whitespace characters, which";
print " may be separated by other characters, in $string1";
}
\d Matches a digit, same as [0-9].
$string1 = "99 bottles of beer on the wall.";
if ($string1 =~ m/(\d+)/) {
print "$1 is the first number in '$string1'\n";
}

Output:

99 is the first number in '99 bottles of beer on the wall.'

\D Matches a non-digit.
$string1 = "Hello World\n";
if ($string1 =~ m/\D/) {
print "There is at least one character in $string1";
print " that is not a digit.\n";
}
^ Matches the beginning of a line or string.
$string1 = "Hello World\n";
if ($string1 =~ m/^He/) {
print "$string1 starts with the characters 'He'\n";
}
$ Matches the end of a line or string.
$string1 = "Hello World\n";
if ($string1 =~ m/rld$/) {
print "$string1 is a line or string ";
print "that ends with 'rld'\n";
}
\A Matches the beginning of a string (but not an internal line).
$string1 = "Hello\nWorld\n";
if ($string1 =~ m/\AH/) {
print "$string1 is a string ";
print "that starts with 'H'\n";
}
\Z Matches the end of a string (but not an internal line).
$string1 = "Hello\nWorld\n";
if ($string1 =~ m/d\n\Z/) {
print "$string1 is a string ";
print "that ends with 'd\\n'\n";
}
[^...] Matches every character except the ones inside brackets.
$string1 = "Hello World\n";
if ($string1 =~ m/[^abc]/) {
print "$string1 contains a character other than ";
print "a, b, and c\n";
}


http://en.wikipedia.org/wiki/Regular_expression_examples

Sunday, March 22, 2009

Thursday, March 19, 2009

Semester 2: Them

Animation
Prof Q

"How's my english? Ok?"
"A lot of maths har? It's not my fault. It's your fault. You chose engineering."
"Ah-har! Let's prove that! Good!"
"So we've proven that! Great. Good. Hehe. Maths again? Well, it is after all the tradition now."
"If you are going to do research on computer vision, you will definitely hear of this guy... And use his snake method and wavelet form... Clever clever guy." (in awe)



VR
Prof Fox

"I can't help you there if your partner is a virtual partner..." Laughs to himself.
-When I told him I am not sure if my partner still wants me in her team for the paper reading.

"Here let me show you. If you sweep in parallel from x-axis, this polo mint will look like it's colliding with this object. But iterate the sweep through all 3 axis and you will realise it was just visual occlusion... Take polo at own risk. Hehe." Pops a mint.

He does all the yar and says idea as "ide" like a typical german guy.

Common mathematical pdf

Ha... I was going scanning for k-means algorithm and stumbled on this guy's site.

Very very nice. He's more into data mining so his algorithms' mostly on clustering and search.

http://www.autonlab.org/tutorials/index.html

Also like his humour:

Primary goal in life: Occasion to use the phrase: "Let me through---I'm a Computer Scientist!"

Monday, March 16, 2009

The best way to understand

... is immersion.


Either by reading or obsessing over it.

Semi-implicit Euler method

The semi-implicit Euler method produces an approximate discrete solution by iterating

v_{n+1} = v_n + g(t_n, x_n) \, \Delta t \quad

x_{n+1} = x_n + f(t_n, v_{n+1}) \, \Delta t \quad

where Δt is the time step and t_n = t_0 + n\,\Delta t is the time after n steps.

The difference with the standard Euler method is that the semi-implicit Euler method uses vn + 1 in the equation for xn + 1, while the Euler method uses vn.

The semi-implicit Euler is a first-order integrator, just as the standard Euler method. This means that it commits a global error of the order of Δt. However, the semi-implicit Euler method is a symplectic integrator, unlike the standard method. As a consequence, the semi-implicit Euler method almost conserves the energy (when the Hamiltonian is time-independent). Often, the energy increases steadily when the standard Euler method is applied, making it far less accurate.


From wikipedia: http://en.wikipedia.org/wiki/Symplectic_Euler_method

3GPP Specifications Numbering

http://www.3gpp.org/specification-numbering

Sunday, March 15, 2009

Friday, March 13, 2009

Sony Vegas wins hands down.

Lovely!

However, I just realised our happy dancing music was quite crap and turns out to be actually creepy. SO I've replace it with:



More on:

http://movie-tv-reviews.blogspot.com/


I love being asian. Look no further than any asian female music and it's all kawaii!!

Sony Vegas vs blender

Now in my impatient attempt to edit my animation short, I want to use something clever but intuitive (overated word these days).

How I wanted to use blender. I mean wow... blender is opensource and includes non-linear editting? I am impressed... But using it is a bitch! I tried following the instructions below... Too complicated for my brain to adhere.

http://eugenia.gnomefiles.org/2008/04/20/video-editing-with-blender/


So gotten a trial of Sony Vegas 7 (unfortunate eh? Since I am still on Windows 2000). Let's see who will win.

Thursday, March 12, 2009

Importing AVI to iMovie

This animation project has given me a thousand and one "a-har" moments, I've stopped being perplexed.

SO how??? Here I am with scene 1 - 5 ready to for audio editing and the idiot just won't add the clips!

Turns out I will need to convert it to an older avi version for iMovie to recognise and import properly... Wokay...

Follow this instructions: http://www.helium.com/items/1255708-how-to-convert-video-for-imovie

Ok, the above doesn't work. And MPG2 video that's muxed will not import into iMovies either. WHaaaaaaaaaaaaat?

http://support.apple.com/kb/HT1372


But I should use expert settings when exporting the movie:

http://forums.macrumors.com/showthread.php?t=302197


I've totally given up on using iMovie now....

Tuesday, March 10, 2009

Creating dust particles?

Oh... dust particles... how you eluded me....

The steps should be:
Create curve.
Particles --> Create emitter.

Then have fun from there onwards... But oh well...

http://forums.creativecow.net/archivethread/2/761053

http://www.highend3d.com/boards/index.php?showtopic=236247

http://forums.cgsociety.org/archive/index.php/t-416001.html

http://www.swinburne.edu.au/design/tutorials/P-maya/T-Maya-Dynamics-Transforming-objects-using-magic-star-dust-particles/ID-119/

This swinburne institution is really something... but the name... aiyo....

Sunday, March 8, 2009

3D text in Maya

We wanted an end credit ala Pixar. 3D words, and our protagonist messing/playing with it.

So we had to import the lettering from either Photoshop or Illustrator. We went with Photoshop as described in the tutorial below:
http://en.9jcg.com/comm_pages/blog_content-art-64.htm

Besides that, we also need to extrude the text. We've used Surfaces: Surfaces--> Loft and Surfaces--> Planar. Then group the each letter together.

However, from the same author, there's another way of doing it:

http://www.youtube.com/watch?v=JJwNOOmkZuU

Saturday, February 28, 2009

Wrestling with Maya

Ha....

What a load of crap... We jumped in without even knowing how to navigate maya... Haiz...

Anyhow... This is an important discovery for the rigging pipeline:

1. Align:
a. Model (textured)
b. Joints
c. Nurbs circle


How to align? Make sure all the 3 above are at point of origin. Check the attributes (Ctrl+A) on the node. I had to realign the joints manually, then translate the model & circle accordingly. But it was not so hard after realising what to do. It's the "How do I do this" that really wasted a lot of my time.

Then:

Modify-->Center Pivot
Modify-->Freeze Transformation


Constraint!!!

Joints + Circle

Constrain-->Orient
Constrain-->Points

Now follow this process to the T!

ALWAYS SET THE IK FIRST BEFORE binding the skin!

Skin --> Bind Skin --> Smooth Bind

This way, the nurbs circle will create a marionette (? wiki check later) for controlling instead of controlling the individual joints.


Then Paint Yer Skin Weights to the joints........... Grr... I did this so many times I want to cry....

Skin-->Edit Smooth Skin-->Paint Skin Weights

There's an "A-har!" here. Always start from the outermost joint, working your way in... And always toggle hold weight.

On painting weights.
Personally, I like to flood with full black bg, then work in the selected joint area.

After that, check the attributes of the joints. Ctrl+A.
Sometimes, this could be turned off. Right Click to see if it's toggled on. X=On.

The most important thing here for natural looking joint bends is the:
Smooth Skin Parameters!!!!

So take care of that here.

Thursday, February 26, 2009

Wednesday, February 25, 2009

Windows- Adding new fonts

In either:

C:/Windows/Fonts

C:/WINNT/Fonts

add your *.tff files here.

Your fonts will be automatically installed.


Oh well... I am so forgetful I need this.

More on this here: http://graphicssoft.about.com/od/photoshop/qt/photoshopfonts.htm

Thursday, February 19, 2009

Friday, February 6, 2009

Thursday, February 5, 2009

Inverse Kinematics -- help for assignment

http://www.darwin3d.com/gdm1998.htm

http://answers.google.com/answers/threadview?id=43974

http://math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/index.html

http://www.devmaster.net/forums/showthread.php?t=7211

http://www.codeguru.com/forum/showthread.php?t=299690

http://www.cours.polymtl.ca/roboop/docs/html/classmRobot.html

http://www.gamedev.net/community/forums/topic.asp?topic_id=516688

Readings!!!!

http://csci520.googlepages.com/



uuuuu useful tools: http://www.sharewareconnection.com/titles/inverse-kinematics.htm

Phoneme shapes to animate speaking characters

Extended Preston Blair phoneme series

It always amazes me how few phoneme shapes you really need to give the impression of a talking character. This article covers a slightly extended range of phoneme mouth shapes, based originally on the Preston Blair series. This extended set adds a few extra mouth poses useful for sequencing mouth movement to dialogue tracks. The main additions to the Preston Blair series is a specific phoneme shape just for Th (as in thanks or thrash) and an additional phoneme shape for the C, D, G, K, N, R, S, Y and Z sounds, which is similar to E but provides an extra target pose when you have a run of sounds that are similar in mouth shape (but need some slight variation for contrast). I find these occur frequently enough to deserve their own poses.

Getting started

Each phoneme shape shown here is accompanied by example word sounds, these are by no means golden rules always be followed - but are there as examples of the kind of sounds the mouth shape represents. If it looks correct, then it is correct and the best trick to getting lip synch looking correct is have an easy way to repeatedly preview your sequence along with your soundtrack so you can go back over the sequence again and again fine tuning poses. Some lip-synch tools (as included with Hash Inc. Animation:Master) provide quick and productive ways of generating your dopesheet timing, other video sequencing programs can also be used to calculate your pose timings but require a more manual process (such as Adobe Premiere).

Phoneme A I

Example sounds are: apple, day, hat, happy, rat, act, plait, dive, aisle.

Phoneme A I

Phoneme E

Example sounds are: egg, free, peach, dream, tree.

Phoneme E

Phoneme O

Example sounds are: honk, hot, off, odd, fetlock, exotic, goat.

Phoneme O

Phoneme U

Example sounds are: fund, universe, you runner, jump, fudge, treasure.

Phoneme U

Phoneme C D G K N R S Y Z

Example sounds are: sit, expend, act, pig, sacked, bang, key, band, buzz, dig, sing.

Phoneme C D G K N R S Y Z

Phoneme C D G J K N R S Y Z

Example sounds are: grouch, rod, zoo, kill, car, sheep, pun, dug, jaw, void, roach, lodge.

Phoneme C D G J K N R S Y Z

Phoneme F V

Example sounds are: forest, daft, life, fear, very, endeavour.

Phoneme F V

Phoneme Th

Example sounds are: the, that, then, they, this, brother.

Phoneme Th

Phoneme L

Example sounds are: election, alone, elicit, elm, leg, pull.

Phoneme L

Phoneme M B P

For many M, B and P sounds, it's important that the phoneme shape should be reached before the M, B or the P sound is made, the sound is often only made as the pose breaks. Example words are: embark, bear, best, put, plan, imagine, mad, mine.

Phoneme M B P

Phoneme W Q

Example sounds are: cower, quick, wish, skewer, how.

Phoneme W Q

The rest shape

The rest shape is not a phoneme as such but a shape used during pauses between words and sentences.

Rest Pose

Get the tweening right

In addition to placing the correct phoneme shape next to dialogue sound, keep in mind how your software tweens from phoneme pose to pose, the default settings are rarely good enough. When you need a clear definition of a particular mouth shape you'll need to space matching or similar mouth poses at the start and end of the hold. A common example is during the rest point between spoken sounds, where mouth movement often pauses. Don't forget you'll need to go deeper in and adjust the timing curves of your phoneme sequence to get the ease in and out of mouth motion looking natural. Rendering after each animation pass - playing the sequence against the audio track is really the best way of catching problem areas and refining your work. My final comment is try not to over cook your phoneme keys (don't have too many). Pick the important sounds and hit their shape clearly to emphasize the dialogue flow. Best of luck!

Related links


Extended Preston Blair phoneme series

It always amazes me how few phoneme shapes you really need to give the impression of a talking character. This article covers a slightly extended range of phoneme mouth shapes, based originally on the Preston Blair series. This extended set adds a few extra mouth poses useful for sequencing mouth movement to dialogue tracks. The main additions to the Preston Blair series is a specific phoneme shape just for Th (as in thanks or thrash) and an additional phoneme shape for the C, D, G, K, N, R, S, Y and Z sounds, which is similar to E but provides an extra target pose when you have a run of sounds that are similar in mouth shape (but need some slight variation for contrast). I find these occur frequently enough to deserve their own poses.

Getting started

Each phoneme shape shown here is accompanied by example word sounds, these are by no means golden rules always be followed - but are there as examples of the kind of sounds the mouth shape represents. If it looks correct, then it is correct and the best trick to getting lip synch looking correct is have an easy way to repeatedly preview your sequence along with your soundtrack so you can go back over the sequence again and again fine tuning poses. Some lip-synch tools (as included with Hash Inc. Animation:Master) provide quick and productive ways of generating your dopesheet timing, other video sequencing programs can also be used to calculate your pose timings but require a more manual process (such as Adobe Premiere).

Phoneme A I

Example sounds are: apple, day, hat, happy, rat, act, plait, dive, aisle.

Phoneme A I

Phoneme E

Example sounds are: egg, free, peach, dream, tree.

Phoneme E

Phoneme O

Example sounds are: honk, hot, off, odd, fetlock, exotic, goat.

Phoneme O

Phoneme U

Example sounds are: fund, universe, you runner, jump, fudge, treasure.

Phoneme U

Phoneme C D G K N R S Y Z

Example sounds are: sit, expend, act, pig, sacked, bang, key, band, buzz, dig, sing.

Phoneme C D G K N R S Y Z

Phoneme C D G J K N R S Y Z

Example sounds are: grouch, rod, zoo, kill, car, sheep, pun, dug, jaw, void, roach, lodge.

Phoneme C D G J K N R S Y Z

Phoneme F V

Example sounds are: forest, daft, life, fear, very, endeavour.

Phoneme F V

Phoneme Th

Example sounds are: the, that, then, they, this, brother.

Phoneme Th

Phoneme L

Example sounds are: election, alone, elicit, elm, leg, pull.

Phoneme L

Phoneme M B P

For many M, B and P sounds, it's important that the phoneme shape should be reached before the M, B or the P sound is made, the sound is often only made as the pose breaks. Example words are: embark, bear, best, put, plan, imagine, mad, mine.

Phoneme M B P

Phoneme W Q

Example sounds are: cower, quick, wish, skewer, how.

Phoneme W Q

The rest shape

The rest shape is not a phoneme as such but a shape used during pauses between words and sentences.

Rest Pose

Get the tweening right

In addition to placing the correct phoneme shape next to dialogue sound, keep in mind how your software tweens from phoneme pose to pose, the default settings are rarely good enough. When you need a clear definition of a particular mouth shape you'll need to space matching or similar mouth poses at the start and end of the hold. A common example is during the rest point between spoken sounds, where mouth movement often pauses. Don't forget you'll need to go deeper in and adjust the timing curves of your phoneme sequence to get the ease in and out of mouth motion looking natural. Rendering after each animation pass - playing the sequence against the audio track is really the best way of catching problem areas and refining your work. My final comment is try not to over cook your phoneme keys (don't have too many). Pick the important sounds and hit their shape clearly to emphasize the dialogue flow. Best of luck!

Related links

Taken from: http://www.garycmartin.com/phoneme_examples.html

Wednesday, January 14, 2009

Our book

On obsessions

Emily
10:31
i feel like he is lonely
same as us
deep inside we just need to share

vvsy@hotmail.com
10:31
yes

Emily
10:31
without worrying if ppl will laugh at us

vvsy@hotmail.com
10:31
i agree
we want so much in life
and in the end, we need to give up something
and alot of us choose the easiest

Emily
10:32
good say

vvsy@hotmail.com
10:32
which is friends
or company
because that is the hardest to control
so we choose the ones we can control

Emily
10:32
plswrite this down!!!!
for our book!!!!!!!!!!!

vvsy@hotmail.com
10:33
career, studies, freelance....
lol
yes yes

When true friends come in all modes

Emily
10:39
I dun like to pretend like I am some little lady
i just love to speak out my mind
hahah
the other i talked to siew peng

vvsy@hotmail.com
10:39
yes i a gree

Emily
10:39
we both feel that
how much we miss the buddies next to us
instead of pc screeen and handphone

vvsy@hotmail.com
10:40
i know....
and worst
we feel our pc buddies more fun than the ppl around us
siao....

Emily
10:40
hahahahhahah
true!!!!!!!!!!!!!!!!
i feel that everyone needs care
tell u another story


It's the little things that count

Emily
10:41
a client's parent passed away
i boguht a hallmark card
and sent to her
she always had account with us
jsut never put money
aftershe rec
she pump in more than rm 1 mio

vvsy@hotmail.com
10:42
WOAH

Emily
10:42
she is financial controller of that comoany

vvsy@hotmail.com
10:42
orh

Emily
10:42
she gets to decide where to put the surplus fund

vvsy@hotmail.com
10:42
i i see
it really is the little things that count.....................................

Emily
10:42
so i bought the hallmark card for rm 10
yes!


On beauty

beauty is not natural
beauty is an effort

Thursday, January 8, 2009

How to pace all the school modules

As of now, I've decided I have to get at least B or B+ to stay in grad school.

Difficult modules:

2D & 3D Animation
Scientific Visualization

Modules with a lot of assignments:


2D & 3D Animation
3D Modelling & Reconstruction
Computer Animation & Simulation

Easy modules:

HCI


This Sem:
VR (core)
2D & 3D Animation (core)
HCI (elective)????????????????????????

Up to this point, I've completed 1 elective.

Next Sem:


Interesting electives:

3D Modelling & Reconstruction
Computer Animation & Simulation
Scientific Visualization

So there... I've chosen the modules I am interested in.

Here's the difficult part. There's a choice here:
1. Dissertation: 6AU == 2 modules of study.
2. Directed reading: 3AU

Option 1 is similar to Full Time option.

Option 2 is a smaller scale of Dissertation but need another module to fulfill all the AU.

If I choose option 2, Then I am quite interested in:

Introduction to Games Design (elective)



The plan is to complete 2 modules each semester; therefore I will complete within 2.5 to 3 years. Ok... Sounds good.

BUT, must decide by this sem if I want to do dissertation or not. Choose your topic, girl.

Wednesday, January 7, 2009

Animation Pipeline

This is one that has been quite a blur for me till now.

However, I am reading from: http://www.donbluth.com/academy.html

And here's what it's all about.

There are 5 major steps the animated film must go through after the script is approved and before the original score and final sound effects are added. They are:

1. Storyboard
2. Ruff Animation
3. Clean Up
4. Special Effects Animation
5. Final Color

I like how this guy puts it:

In the past, people would have said "assembly-line". In computer graphics, one uses the term "rendering pipeline" and I think it's possible that the term "animation pipeline" developed from it. It may well now be used for traditional animation as well, but I suspect that it came from computer graphics and animation.

"Pipelining" is a programming term. "Pipes" are a typical feature of UNIX-like operating systems. A "pipe" is an entity that makes it possible for different processes to communicate. In fact, this topic is called "Inter-Process Communication" or "IPC". Pipes are one way of performing IPC; there are others. A typical style of programming in UNIX-like environments involves the use of "filters". A "filter" is a program that reads the output of one program and writes to the input of another using pipes.
If you type a command at the command line that looks like this:

> program_a | program_b | program_c

the "|" characters represent pipes. If you're programming, you can create pipes explicitly in your program.

The process of creating complex computer graphics can be implemented in this way. A single, monolithic program doesn't have to do all the jobs. For example, you could write a modelling program that passes its output to a program that does hidden surface removal. It, in turn, passes its output to a program that performs the first stage of rendering. Rendering is quite a complex task, so it's reasonable to divide it up into several stages.

Laurence Finston

Wednesday, December 31, 2008

Why aren't we out partying?

I was slathering lotion on my body, getting ready to go to bed. He was fixing the router, generating a new ssid and password.

When he asked,"Why aren't we out partying?"
I said,"I am wondering the same thing myself. We're like old people, eh? But doesn't matter. I want to sleep. I am sick."

He said,"Partying sucks anyway."

I looked at him,"Whatever, good night!"

So we ended up sick, both of us. Me fixing him TCM throat remedy. Him changing all the rugs. Me buying new duvet. Him clearing all the old furnitures. Me counting threads on the new bedsheets. Him rewiring the house's network. Me picking out new curtains.
We've gone from 25 to 65.

Sunday, December 21, 2008

Oral Fixation

See my fingers?
What's that?
I bite. Now they're all infected and bleeding. When the new sem begins again, they will bleed even more.
You should do like that guy in Boston Legal. Bite on a wooden cigarette. For him, it's an ego trip.
I don't get it. I don't need an ego boost.
Ya... but it's still an oral fixation.
Muahaha.
Gosh... You're such a perv.

Wednesday, December 17, 2008

All excited and no one to tell to

I came back all happy and excited. The things I learned. The people I met. The knowledge. The knowledge!

I sit in the office bursting with joy. Sadly, there's no one to tell to. And suddenly I say, "I wish he is here, I would really like to tell him."

My only friend in the office. And he's not here. Just for a moment, I wish he is here, so I can tell him about Siggraph. About scattering. About the technical papers presented. About everything.

Today, I want my only office buddy back. Because he's the only one whom I can talk to. And unfortunately, he still is.

Monday, December 15, 2008

Results' next week

My stomach's in knots.

I am watching you

Please don't belittle my technical skills. I know you've been coming to my site regularly. I have a more complex than normal tracker.

At least spoof your network or something. This is too easy for me. Come on!

I am still watching you....

Thursday, December 11, 2008

Breathing the same air as Don Greenberg

Is way cool.

But oh so tiring. Everyone was rushing and running around to attend their selected conferences, papers presentation, speech. I was being the usual polite girl as I was and wanted to wait till the applause quiet down before standing up to leave but I see others just walked out during applause.

You see, it's like those concerts... SXSW etc. Where at a given time a few dozen events, speeches, presentations, showreel, theatre are happening. So you really have to plan your time well. I only attend mostly the courses but I plot my itineraries at least one day ahead. Oh I better sleep now. Discrete geometry starts at 8:30am tomorrow.

Monday, December 8, 2008

Polar opposites


This illustrate the different kind of people attending. Then there's the other kind: nerds. I can't take any pics cause the fragile phone lens might crack.

Money is the root of all evil

He: I am going broke. You know why, don't you?
Me: Yes.
He: Do you know how much you owe me?
Me: Err... 9k?
He: 11k. Do you have a financial plan?
Me: ... I am getting a few thousand soon. I can pay you 3k? As long as you feed me. Because I really don't have much.
He: I don't mean that. Just what about the ongoing? Do you have a plan?
Me: ...
He: Gosh. Now you're like the US govt. Even after you pay me the lump sum with your bonuses, can you afford the ongoing rent?
Me: ...
He: Can you not be such an airhead?
Me: But I am such an airhead.
He: You have to start planning your finances.
Me: I took a pay cut when I joined this company. That was the rent. They promised to give it back in 3 months but they didn't. I'll bet you didn't know that.
He: ...
Me: Let's see how it all goes. I can pay you back that sum with my bonus. Definitely! And then I will see how I can deal with the monthly part.
He: You better. Don't let it pile up.


I am officially broke and up to my neck in debts.

Friday, December 5, 2008

You can be really nasty in academics and no one will stop you

That's what I think.

I have some of the nastiest professors and they just get away with it. Knowledge is really something, isn't it?

1. Prof Mint
"Hello class? Wah lau eh! Interactive lah? Only me talking, very boring wei."
*puts up all the stupid emails he received on powerpoint and presents it in lecture* "You asked me what is the best research topic to choose? Hey, you're the one doing it, not me."
"Anyone here? All sleeping? Haiz...."

2. Prof Elvis
"Well, if you want to know more, I can prove the whole equation here" *walks to the projector* "On second thoughts, it really ain't that interesting, I think I will skip this" *walks back to his notebook*

3. Prof Gerald
"You traverse through all the objects in your near child node, and recurse, recurse, recurse till you find a hit. Else, go to far child node and recurse, recurse, recurse" *flip his waist length hair*


3. Prof H
Professor H is by far the most mild of the lot. However, when I asked him about my assignment, he gave me the look like I was the kind of kid who used to bully him in school. Maybe I am. Mua ha ha.

Prof Sore Throat

"Hello?"
"Yello"
"Are you having a sore throat?" *I have the worst thought in the world. I was thinking that he might be waiting for a phone call from his office affair and wanted to to surprise her with a kewl voice*
"Why? Do I sound like I am having a sore throat?"
"Errr. Yes" *A no will suffice*


"What's a MAE prof doing chairing a computer graphics conference?"
"I get asked that a lot. It really is very strange, isn't it? I've been an active member since... since before you were even born!"

"I am really excited to attend this conference. I checked the speakers and some of them are the godfathers of computer graphics."
"There are a lot of computer graphics godfather here. Like this and that. Oh and you really have to attend this conference. And the fast forward. It is the pitch of their technical papers. And very funny."

"Somehow I think in academic, you get away with speaking your mind."
"Haha. Somewhat. This is still Singapore after all. But really, why would you say anything otherwise?"

"You should go for the reception. Let me check if students are invited for the reception. Hehe. I have people I can call that will tell me these things *gleeful*. Ok. Please attend the reception. I hope you get to mingle and meet people there."

I think... he is trying to say, network. Of course, Prof! I will!!!! You guys are too cool!

Our happy book

I've totally forgotten about the happy book project.

Em and I will try to self-publish a little happy book. It's gonna be mostly crap but our own happy crap.

She draws some of the cutest little things. Me? I am just a muse. Eerr... well I will provide the words. Somewhat. I thought I will defer and have all the time in the world to do it from next month onwards. But I guess not. We shall start now!

Wednesday, December 3, 2008

See what the monkeys got me



We were in Marks & Spencers when C asked me what's the best chocolate here.
I showed him the huge fruit cake and said, "I really want to eat this but it cost $69! You see the tag? And such a big cake. Oh it has cognac too. See?"

"Ok. I am getting this."

*totally flattered that he trusts my taste in food* "You're getting for your mum? Says here it will last till march."

"No. the guys are getting this for you."

"You're kidding me right? It's $69! For a cake! You know that is too expensive! Add another $8 and you can buy an ipod shuffle!!"

"No. You want this. So we're getting this for you."

"Noooooooooo this is mad. You're kidding right?" *I've been really nasty to them and they're so good to me?*

"Nope. I am going to pay now."

I didn't believe him till he paid and handed me the cake.

"Does this mean I can't call you monkey or say D is fat?"

I am so touched.... The indian boys want to feed me. Uhuk

Windows-how to write batch file

I feel stupid right about now. I am not interested and I don't want to learn.

http://www.robvanderwoude.com/bht.html

I'll just use cygwin.

Oh wait. I found exactly what I need: http://www.cknow.com/tutorcom/dos08_dealwithfiles.htm

And some misc batch scripts by some misc person: http://www.geocities.com/~budallen/batfiles.html

Monday, December 1, 2008

1st Singapore Tattoo Show 2009

Wooooooah! I can't believe this! I have to go!

9th to 11th January 2009 at Singapore Expo.

I am so excited. Chris Garver from Miami Ink fame. Hmm... But of course, I am a little biased and absolutely in love with Kat von D. But woohoo!! I can't wait!

December and January is going to be so exciting for me.

Find the details here:

Singapore Expo Calendar

http://www.tattoo.com.sg/

Dessert with quark and jude


At al-majlis on arab street

Sunday, November 30, 2008

Ah er


He he

Jude in love



Ice cream with mum


Too bad she dig in too fast. All that's left is this sugar snowman. That i licked. Ha ha

Thursday, November 27, 2008

Relaxing at work

Which is something I rarely do. But today we were all shouting and laughing. Because it is a relaxing day.

We were all talking and telling stupid jokes and slam book? That is one good joke. Anyways we started exchanging stories about first crush and all. That's wierd. I don't tell colleagues my childhood stories. But I did this time. And we log into facebook and orkut for the whole show and tell.

"We can't see the picture of the guy you like. Why didn't you add him?"
"Why should I? He was my first crush. I was thirteen. Long time ago."
"Oooh. But we can't see his face."
"Doesn't matter."

Then we started talking about other stuff. I told them about SIGGRAPH Asia. One guy said, "Don't be so stingy. Just pay the $450 and go for it already."
"Pay money and sit in classes torturing myself with C++ and graphics programming?"
"You want to go."

He is right. I do.

Yes I will! I can't wait.

Tuesday, November 25, 2008

SIGGRAPH Asia 2008

Oh wow! SIGGRAPH Asia in Singapore! 10th to 13th December!


Find the details here: http://www.siggraph.org/asia2008/attendees/index.php

Saturday, November 22, 2008

BD

Well with the rate I torture myself, I guess I might be one of those closet BDSM kinda person.

So exams' over, I've submitted the project hours ago and I should be so relieved and sleep to make up for the past semester. But I can't. I mean yes, I am relieved and I woke up this morning shouting "Yay!" with my hands in the air (the other "Yay" is cause I will be seeing punjabi boy in January). But I can't sleep. I can't fall asleep. I just am not tired enough.
Maybe I am just hungry. I forgot to eat today. I just had some chips and coffee. That's lunch and dinner.

I can't sleep. I can't sleep. What do I do?? I fell into this site today. I forgot how. But I just did. So I started reading. And I thought, hmmm... Cool. Then I get a headache reading them. But I need to sleep and I will take any kind of torture just to be able to sleep. Or I could work on my Phong equation codes again. I don't want to. Too soon to start slaving away on the CG codes.

So here I am alternating between reading some call girls' blog and buying makeup online.

Friday, November 21, 2008

For the greater good?

You broke the rules.
That's what she was trying to imply.

Ok... Am I in trouble?

"I've been involved for the whole of this episode. We have rules for a reason. What we're doing now is not according to company protocols. But we realised you're an asset. I've heard good things about you. So we're doing this because it is beneficial to the company."

Oh... really? I've always thought I'm such a nuisance here.

"The managers and directors have all agreed on this. We've all come together and this is the decision we've made. For the company's benefit, we've all agreed to your transfer. Your new role starts on Jan 1st. I've heard good things about you. Except..."

Hold my breath.

"You talk to fast."

Huh?

In my own twisted world, I imagined the whole episode goes like the nuns' singing about Maria in Sound Of Music.

Thursday, November 20, 2008

glMatrixMode Cheat Sheet

void FunctionRunWhenProgramStarts()
{
glMatrixMode(GL_PROJECTION); // signal that I want to work with the projection stack
glLoadIdentity(); // make sure that the projection stack doesn't already have anything on it
gluPerspective(whatever I want); // set up a normal perspective projection

glMatrixMode(GL_MODELVIEW); // the rest of my app will only change MODELVIEW
glLoadIdentity(); // make sure that the modelview stack doesn't already have anything on it
}

void FunctionToDrawAFrame()
{
// modelview is still the active stack, because I never that setting
glPushMatrix(); // push current matrix up one, because I'm about to do a bunch of stuff that shouldn't remain active after the end of this function

/* position camera - whatever code you want, this is just an example */
glTranslatef(cameraX, cameraY, cameraZ);
glRotatef(cameraAngle, 0, 1, 0);

/* draw all objects */
for(all objects)
{
glPushMatrix(); //we don't want each object to move the camera...

glTranslatef(objectX, objectY, obectZ);
glRotatef(objectAngle, 0, 1, 0);

DrawObject(); // whatever method you use to draw your object

glPopMatrix(); //restore unaffected camera for next object
}

glPopMatrix(); // restore view prior to movement by this camera
}


From: http://www.allegro.cc/forums/thread/595000

Tron

One of my favourite sci-fi movie as a kid. My brother and I would watch it every week, I think. It was good. It was vivid even though I cannot remember much now; except for the lights, the bike and the race.

Relentless Quark had to remind me the game they play in the movie. It's Light Cycle.
Anyways, for the uninitiated, here you go:
http://en.wikipedia.org/wiki/Light_Cycle

Wednesday, November 19, 2008

GL Mouse Picking and Selection

Oh eh.
I think I might might have a solution to the mouse picking problem.

Could it be:

1. viewport problem?
2. matrix transformation problem?
3. z-buffer depth search problem - check in function processHits();

Read this: http://www.opengl.org/resources/faq/technical/transformations.htm

Wow! Very nice!!!!

3D Computer Graphics Tutorial:

http://www.jimbrooks.org/web/opengl/tutorials/

EDIT:
Was looking at the visitor stats and realised a lot of people come to this post when searching for OpenGL mouse picking. I've solved it.
Point is, if you want to pick in 3D; there's no straight forward way to doing that entirely in mouse.
What you can do is, specify another keyboard key + one mouse action for z-coordinate. Why? cause glut mouse function only specifies x,y coordinates. That's the easiest way to doing it.

That bugger

Saw a picture of my brother, on his girl friend's facebook.
My heart did a leap. I've not seen him for the past 6 months.

How do you look like now?
Are you thinner? Are you older? How have you been?

Are you world weary now? Life can be cruel sometimes. Hang on. I am coming home soon.

I miss you. Can't wait to see you.

Tuesday, November 18, 2008

Stare at the table

That's all I could do. When the announcement was made. That I am leaving. I don't know what to say.

No reaction from the crowd. I dare not breathe. In case breathing might offend. I hang my head and let my hair fall around my face. Hoping my face will be occluded.
Nobody say anything.
Nothing! Nothing! I held my breath till my face turned purple.

"Thank you for being with us for the past one year."
Is that the cue for me to speak? I still dare not. I smiled and nodded.

Continue staring at the table.

Monday, November 17, 2008

Get around

1. OpenGL matrix distribution (memorised translate, rotate, scale). Also need to memorise perspective.

Read this on the sin and cos for 3D programming: http://pixwiki.bafsoft.com/mags/5/articles/circle/sincos.htm

Homogenous coordinates:
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MOHR_TRIGGS/node7.html

This for better explanation on the 4x4 matrix as used in OpenGL.
http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm

2. 3D viewing and perspectives. Eye, World, Object view.

3. OpenGL commands...

4. Finish all the past year papers.

Sunday, November 16, 2008

Thank god?

What will your team say when they find out you're leaving?

Eerrr.... thank god? She's a real kryptonite?

Saturday, November 15, 2008

Sick Sick Sick!

Been sick for the past 2 days. Oh No! 2 days wasted. Gone. And I need to start studying for CG exams. And the darned FFD project for geometry.

If I don't finish CG today, I am not allowed to sleep. Ok. That's it!

Friday, November 14, 2008

The good girl

Who's responsible for herself.
Her family.
Who listens to her parents... somewhat.
Does everything well.
Does everything they want her to, except... get married.
To a chinese boy.
Homogeneous. Just like her maths equations.
She will never defy them. And break their hearts.
So she chooses never to
But she will never tell them.
She just apologise and kept herself busy.
Here is where she will fail them.
All because,
she is hard to impress.

Strange dreams

Sick. Took my meds. Fell asleep. ND called.

Dreamt that I jumped into his car and he was driving around backwards.

Dreamt that bro was found guilty. Without bail. Confused.

Dreamt that my shoulder and ass hurts from dragging my bag around. Which could be true. Since it did hurt my shoulder very badly.

Dreamt about graphics pipeline. Dreamt about exams.

Dreamt about work. Dreamt about the dreaded meeting to announce my departure.

Wednesday, November 12, 2008

My first Christmas & New Year

This will be my first Christmas & New Year with the new system.

Used to dread this time of the year. Spent most of the time in switch. Tortured, stressful, sleepless nights.

How about this year?

You are wasting my time look

As I was explaining the procedure, he interrupts and said, "Oh ah and then this part?"

I replied,"I have not finished talking yet. I will come to that part once I am done explaining this to you."

"Oh hehe. So I have to pay you? Ah with Malaqa money?"

*Look at him from the corner of my chinky eyes* "Can we continue?"

3D Game and Graphic Engine DB

Somehow I found the graphics algorithm a better read than the game engine portion:

http://www.devmaster.net/articles/graphics_alg/


Find it here. Check them out during sem break:
http://www.devmaster.net/engines/

Monday, November 10, 2008

Please, Just make up your mind!

Too many crap happening.

Just make up your mind. Yes? No? Ok. Let's go!

And then there's the biggest longgok... lol. Love Jude's way of saying it.
School. Family. Work. All drama at the same time.

Jude told me it's alright to defer. As she puts it:
You don't want to fail and repeat school. And fail at work? Absolutely not. Cause we are the best!

I will buy her whatever she wants to eat after this. And she really can eat even though she is so small.

Embarassed closet maths nerd

I was going "uuwaaaah" and told myself I want to play with this during sem break:

http://projecteuler.net/index.php?section=about

I really do.

Sunday, November 9, 2008

All about R-tree

While reading up on Rectangle Tree (R-tree), I came upon this site:
http://www.rtreeportal.org/

Saturday, November 8, 2008

My punishment

I was not studious at all in school. Or during my first degree.
So I guess, I am really really making up for all of it now. Ugh!

Mean thought. I hope the rest of the class did badly too.

Why do I torture myself like that? I cannot explain.

Someone asked,"Why did you decided to do this?"
To which I replied, "To open my chakra."