<< Chapter < Page Chapter >> Page >

It is also useful to set only one of the rotation angles to a non-zero value and watch the rotation around a line parallel to that axis take place.

A stop-action screen shot

Figure 4 shows a screen shot of the disk in motion somewhere between the beginning and the end of its very complex trajectory forone particular set of rotation and anchor point parameters.

Figure 4 Screen shot of the graphic output from StringArt04.

Missing image.


I will also provide exercises for you to complete on your own at the end of the module. The exercises will concentrate on the material that you have learnedin this and previous modules.

Discussion and sample code

The game-math library named GM01

The game-math library named GM01 has not been modified since I presented and explained it in an earlier module titled GAME 2302-0135: Venturing into a 3D World . A copy of the source code for the library is provided in Listing 30 for your convenience. Since Ihave explained the code in the library in earlier modules, I won't repeat those explanations here.

A link to a zip file containing documentation for the library was provided in the earlier module.

The game program named GM01test08

This is an interactive 3D game program. In fact, this is the first game program that I have presented in this collection on game math. This gamesimulates a school of prey fish being attacked and eaten by a predator. The objective for the player is to cause the predator to eat all of the prey fish ina minimum amount of time. Although the story line of the game is rather simple, the math involved is not simple at all.

Player initiates attacks

The player in this game initiates a series of attacks by the predator by clicking the Attack button shown in Figure 5 . The winning strategy for the player is to time the attacks in such a way as to minimize the elapsed timerequired for the predator to eat all of the prey fish. The final elapsed time depends on both strategy and chance. In other words, as is the case in manygames, this game is part strategy and part chance.

A swirling cluster of prey fish

The prey fish, (shown in red) , tend to swim in a large swirling cluster as shown in Figure 5 when they aren't being harassed by the predator.

Figure 5 Prey fish in a large swirling cluster.

Missing image.

Predator behavior

The predator, (shown in blue in Figure 5 ) , swims around the cluster, darting into and through the cluster when the user clicks the Attack button. During an attack, the predator attempts to eat as many prey fish aspossible. When the predator attacks, the prey fish tend to scatter (as shown in Figure 1 ) , breaking up their tight formation and making it more difficult for the predator to catch them. If the predator is allowed to swim around themagain for a short period following an attack, they will form back into a cluster.

Proper timing is important

The attacks should be timed so that the prey fish are in a reasonably tight cluster at the beginning of each attack so that multiple prey fish will be eatenduring the attack. However, allowing too much time between attacks is detrimental because it increases the total elapsed time. Thus, the player mustmake a tradeoff between elapsed time between attacks and the tightness of the cluster at the beginning of each attack. Another disadvantage of waiting too long between attacks will be explained later.

Questions & Answers

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Game 2302 - mathematical applications for game development. OpenStax CNX. Jan 09, 2016 Download for free at https://legacy.cnx.org/content/col11450/1.33
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?