{\rtf1\mac\ansicpg10000\cocoartf102 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh9000\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \f0\fs24 \cf0 bichos\ \ Things I used\ \ collision detection\ animation\ texture\ \ \ \ My project is an experiment in collision detection \ for my objects I initial just used two circles to figure out how to do in a simpler form. To make it a bit more interesting than a bunch of spheres bouncing around I decided to make my objects bugs and as I am trying to learn spanish I decided that my bugs were spanish.\ So there are two types of bugs \ in the final project they are pink and blue I stated off with red and yellow ones \ When the program starts ( I have hard coded the number of bugs in) a use an enumerator to flick through and decide if the bug is going to be of type a or type b\ the speed of the animation and the quality of the bugs ( the number if sections ) \ has been reduced in this example because of the speed restriction of the hard ware\ \ \ \ The next difficulty I had was trying ti make them walk For a lot of my project I was working on just one bug making them walk. I used simple cylinders to-make the legs then used rotation to make them appear to walk. I then decide where the leg should be over a specified frame set then used a count to and if statement s to determine where in the range the leg should be then put it at that position I did this for each sub part of the leg \ \ \ So once I had a walking bug I needed to make them move around the plane. \ \ I decided to use 2d collisions in this project so each bug has a position in 2d encompassing each bug also has sates these are \ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \cf0 anandao = walking\ girando = turning \ machacdo = crushed \ machacado = crushing \ siendo machacado - being crushed\ encarando= facing \ encarado = faced \ salidano = geeting \ ganador = winner \ \ so I iterate through the array of bugs for each bug seeing if there positions match or if they are hitting the edges of the plane if they the state of the bugs change so firstly it turns t on the spot to face its contender it then executes the appropriate animation depending on its size value it then returns to the walking state.\ \ of course I am keeping an array of the bugs and this actions are done through pointers to the array This means that I can tell when the arrays are empty of one sort of bugs so I can then get the bugs to preform the celebration animation when this occurs \ \ \ To draw all my objects I had a utility class that drew semi circles cylinders a\ it also defined the point struts that i used to compare position and work out distance and direction from a bug to the edge or the bug to another bug the until also contained methods to find normals and do matrix multiplication.\ \ \ the other difficulty that i had was texturing the ground as grass. To do this I had a bitmap class that loaded the texture then I used this in the sulelo class ( suelo is ground) I wrapped and repeated the texture then used glTexCord to apply the texture.\ \ The lighting I have implemented at this stage is very simple simply to create highlights on the bugs bodies\ \ The shadows are simply the bug drawn again but with out the z values so it becomes flat\ \ I had some trouble with the squishing at first I just completely reduced the z value this made the squishes look white when i wanted them to retain there colors so instead of making it z i now make it 0.1 this seems to stop the z fighting that was making the squishes white. \ \ Over all I am pleased with my project but would of liked to texture the bugs and optimize it so that it ran faster I wazs begining to implement more user options but simply ran out of time.\ }