Feature 5 – Emmertac
May 9, 2013 by emmertac. Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
cs455, postmortems, spring 2013.
Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 3030
Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/class.jetpack.php on line 4255
Deprecated: Creation of dynamic property Jetpack_Carousel::$localize_strings is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.php on line 339
Trying to tackle this feature shows how much effort is put in video games try to blend people walking up and down some sort of incline to make it seem real.
At first I tried to solve this by grabbing the closes vertex then taking the average of the neighbors which isn’t very accurate but it demonstrates the purpose of this assignment.
Then I attempted to change it to a spin off of linear Interpolation at a specific point. I measured the hypotenuse from the 4 corners and took a percentage of that to the height. But I was having problems when putting all the numbers together because they contained weighted averages.
My latest attempt was to throw out hypotenuse and just measure the containing area of each corner to the height which gave me a closer approximation. For instance if my (x,y) was (33.56, 20.45), then xDouble = .56 and yDouble = .45. Then depending which corner, decimal or 1-decimal, I would use these values and multiply them with a corner and then add the 4 corner contribution float values together for my new camera height.
Here are some examples along with some detail pictures.


2nd picture: middle row represents contributions from corners, topleft, topright, botleft, botright respectively. Last row represents cameras previous y position then moved to terrainY value.
Here is another picture.


Notice how every change in either x or z changes camera’s height which at some times is nice and fluid and other times it is very jagged. So I’m curious how you can make it near-perfect camera transitions.
Resources to accomplish this Feature: Chris and a couple peers, I also used the c++ book, that he gave out in 330, to double check if I was crazy or not, finding an error if outputs were the result of me accessing wrong locations or if it was an arithmetic error in my algorithm.