Thursday, January 9, 2014

Remote Access to Ubuntu Linux Machine with GUI available Using Cygwin/X

First you need to install cygwin/x with openssh packages as well as X11 Windows System:
http://www.larsavery.com/blog/how-to-install-sshd-secure-shell-server-on-windows-using-cygwin/
And install everything under x11 tap. That might take a while to install X11.

Next, open cygwin terminal, before use ssh to remote connect, run xwin:
$ xwin -multiwindow &
You can test it with 
$ xterm &
to see if it works.

After running xwin stand alone, you can use ssh to connect to linux machine:
ssh -Y [remote-host]
The -Y means you are allowing X11Forward to your server host (such as the Windows PC you are sitting in front of). After successful connection, try 
$ firefox &
to see if Firefox at the Linux machine can show up in your server host.

Monday, November 18, 2013

Finite Element Method - Elastic Ball


This video is part of the assignemnt of class Physical-based Animation.
I implement the elastic effect with standard Finite Element Method: http://graphics.berkeley.edu/papers/Obrien-GMA-1999-08/

Tuesday, November 12, 2013

On Going Ray-tracing Class Project

Here is my ray-tracing class on going project page:
http://www.cs.utah.edu/~owuntu/cs6620/index.html

Feel free to leave some comments, ask questions, point out problem, or rush my ray!

Ray-tracing Refraction - Floating Point Error

To implement refraction in ray-tracing rendering, we can simply use the refraction equation:
sin(theta1)/sin(theta2) = n2/n1

To compute sin(theta1), simply:
cos(theta1)= v1.dot(N);
sin(theta1) = sqrt(1-cos(theta1) * cos(theta1)); 

where v1 is the incomming ray direction, and N is the surface normal.
However, there may be trouble when this implementation runs in computer. In C++, since we can't avoid floating point error, when v1 is almost perpendicular to the surface, that is, v1 and N almost the same (or they just be the same), cos(theta1) could slightly greater than 1 (something like 1.00001). Then, this result would cause:
1-cos(theta1) * cos(theta1) < 0
And sqrt(a) would return invalid result if a<0. So that sin(theta1) becomes a invalid value. Eventually, all the computation mess up. The pixel we want to shade becomes an error pixel. 
To avoid this, simply put a check routine like:
cos(theta1) = min(1.0f, v1.dot(N))

Never trust floating point number!! 

Wednesday, April 10, 2013

Progress Since Turn to "Vinyl" team

Since "Rover Rescue" get cut, I turn to the "Vinyl" game team.

Vinyl is a music game which it give you audio feedback (or reward) about your game play performance. It is a third person view game, you are looking at the vinyl pin and control it like a skate board. And the pin is traveling inside a vinyl track. We already have a video of the prototype:
http://www.youtube.com/watch?feature=player_embedded&v=IQGS7w8ybnA

Right now I am adding physical simulation to the pin movement. It should look like skate boarding. I am using a 2D space to calculate the position, and then project it back to the actual 3D space. The reason I do in this way is I want the pin constraint on the track surface. So the pin movement is actually in a 2D space. I think this idea maybe similar to a subject in Machine Learning - Kernel Space projection.

"Rover Rescue" Get Cut and Now it Turned to be a "Zombie" Project

Rover Rescue get cut in about one month ago. Sorry for updating it so late.

It was very tough for us to face the truth that our lovely Rover get cut at that time. Every thing seemed very good at that time but suddenly, 4 thesis games cut down to 2 games and Rover was one of them that fail.
However, some of the Rover team member still wanted to make this game. We decide to go on and make Rover as a "Zombie" project. So far our Rover team has 5 people: Zeph, Chongze Yang, Ziyao Chen (new member!), Alice and me. We went over the suggestion from the Gate 1 presentation, and discussed about how to re-design the game. Some features kept and we are going to make another prototype first on CryEngine.

As a programmer, I don't like those GUI game engine such as Unity, CryEngine, UDK. That's because I don't have 100% freedom to build my own thing. However, consider that we don't have many people, and probably don't have much time to work together. Also, if we going to build our own engine first, it would take a long time before we begin to build the game. So I think we can build the game on CryEngine first, build the mechanics, to see if it is great. Then, we can decide whether to build our own engine for the game and redo everything. The idea of this is sometimes maybe CryEngine implement the game in the way not we want, or it may do thing stupid though it still make things work. So we can rebuild the game in our own engine, and make our engine to the right thing.

Of cause, we may not be able to build every thing of the engine if we decide to make it. I'd like to build the engine base on some 3rd party open-source library such as OGRE and Bullet-Physics. Those C++ library doesn't have a GUI environment, but has enough manipulation to build a costume engine as well as some basic support such as rendering and physics simulation.