http://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&feed=atom&action=historyCISC440 S2018 HW3 - Revision history2024-03-29T05:27:49ZRevision history for this page on the wikiMediaWiki 1.28.0http://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&diff=1134&oldid=prevCer: /* Required elements */2018-04-17T17:40:57Z<p><span dir="auto"><span class="autocomment">Required elements</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 17:40, 17 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l36" >Line 36:</td>
<td colspan="2" class="diff-lineno">Line 36:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** Fill in its ''update()'' function (and make any other necessary modifications to member variables and the constructor) so that it chases flockers based on a ''hunger_force'' '''[3 points]'''</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>** Fill in its ''update()'' function (and make any other necessary modifications to member variables and the constructor) so that it chases flockers based on a ''hunger_force'' '''[3 points]'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Modify the Flocker class so that it has a ''fear_force'' that makes it flee from Predators, with high priority, when they get close enough '''[3 points]'''.  This does not necessarily need to be pure avoidance---there could be a different (e.g. zigzag) motion mode that is activated.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Modify the Flocker class so that it has a ''fear_force'' that makes it flee from Predators, with high priority, when they get close enough '''[3 points]'''.  This does not necessarily need to be pure avoidance---there could be a different (e.g. zigzag) motion mode that is activated.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Modify Bullet_Utils.cpp so that <del class="diffchange diffchange-inline">the </del>''velocity'' of each flocker is transferred to the corresponding rigid body when switching to physics mode '''[<del class="diffchange diffchange-inline">3 </del>points]'''<del class="diffchange diffchange-inline">, and so that a </del>pair of the ''vertical'' sides of the box become obstacles like the ground '''[3 points]'''</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Modify Bullet_Utils.cpp so that<ins class="diffchange diffchange-inline">:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">** The </ins>''velocity'' of each flocker is transferred to the corresponding rigid body when switching to physics mode '''[<ins class="diffchange diffchange-inline">4 </ins>points]'''  </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">** A </ins>pair of the ''vertical'' sides of the box become obstacles like the ground '''[3 points]'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Please include a README with your submission that briefly explains your approach to the Predator drawing and ''hunger_force'', as well as the Flocker ''fear_force''.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Please include a README with your submission that briefly explains your approach to the Predator drawing and ''hunger_force'', as well as the Flocker ''fear_force''.</div></td></tr>
</table>Cerhttp://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&diff=1125&oldid=prevCer at 04:16, 13 April 20182018-04-13T04:16:44Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 04:16, 13 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>''Due Thursday, <del class="diffchange diffchange-inline">March 16</del>''  </div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>''Due Thursday, <ins class="diffchange diffchange-inline">April 26</ins>''  </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Description==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Description==</div></td></tr>
</table>Cerhttp://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&diff=1124&oldid=prevCer: /* Install instructions */2018-04-13T04:14:08Z<p><span dir="auto"><span class="autocomment">Install instructions</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 04:14, 13 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l52" >Line 52:</td>
<td colspan="2" class="diff-lineno">Line 52:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The download will unzip to a directory called <tt>bullet_creatures</tt>.  This directory should be placed in the OpenGL tutorials hierarchy at the same level as the other tutorial and playground directories.  To compile the code in it, you will need to target the bullet_creatures directory.   </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The download will unzip to a directory called <tt>bullet_creatures</tt>.  This directory should be placed in the OpenGL tutorials hierarchy at the same level as the other tutorial and playground directories.  To compile the code in it, you will need to target the bullet_creatures directory.   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>On Ubuntu, this meant modifying <tt>CMakeLists.txt</tt> and running <tt>cmake ..</tt> one time from the <tt>build</tt> directory.  Then <tt>make <del class="diffchange diffchange-inline">creatures</del></tt> and <tt>launch-bullet_creatures.sh</tt> should work.  Here is a link to the modified [https://drive.google.com/file/d/1rvN4NOCN40xSpAzoqPy4IdLy1pNXHAUZ/view?usp=sharing CMakeLists.txt] -- let me know if you are still confused about what changes to make.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>On Ubuntu, this meant modifying <tt>CMakeLists.txt</tt> and running <tt>cmake ..</tt> one time from the <tt>build</tt> directory.  Then <tt>make <ins class="diffchange diffchange-inline">bullet_creatures</ins></tt> and <tt>launch-bullet_creatures.sh</tt> should work.  Here is a link to the modified [https://drive.google.com/file/d/1rvN4NOCN40xSpAzoqPy4IdLy1pNXHAUZ/view?usp=sharing CMakeLists.txt] -- let me know if you are still confused about what changes to make.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><!--On Piazza, please post what you need to do for XCode and Visual Studio if it is non-trivial.--></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><!--On Piazza, please post what you need to do for XCode and Visual Studio if it is non-trivial.--></div></td></tr>
</table>Cerhttp://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&diff=1123&oldid=prevCer: /* Graduate students only */2018-04-13T04:13:26Z<p><span dir="auto"><span class="autocomment">Graduate students only</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 04:13, 13 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l42" >Line 42:</td>
<td colspan="2" class="diff-lineno">Line 42:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Graduate students only==</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>==Graduate students only==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Modify copy_flocker_states_to_graphics_objects() and copy_graphics_objects_to_flocker_states() in Bullet_Utils.cpp so that 3-D orientation information is properly transferred back and forth between the graphics side and the physics side of the simulation '''[2 points]'''</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Modify copy_flocker_states_to_graphics_objects() and copy_graphics_objects_to_flocker_states() in Bullet_Utils.cpp so that 3-D orientation information is properly transferred back and forth between the graphics side and the physics side of the simulation<ins class="diffchange diffchange-inline">.  This means that in DRAW_MODE_OBJ your models should be drawn at different orientations </ins>'''[2 points]'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Draw a vertical cylinder of radius 1 in the center of the box (it should go from floor to ceiling of the box).  Make changes to both Flocker and Predator (1) ''spawning'' so that none are born inside the cylinder, and (2) ''motion behaviors'' to avoid this cylinder smoothly while still exhibiting their other natural behaviors '''[2 points]'''.  The cylinder should drawn with solid polygons (not wireframe) in a striped or checkerboard pattern with colors that contrast with the boids.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Draw a vertical cylinder of radius 1 in the center of the box (it should go from floor to ceiling of the box).  Make changes to both Flocker and Predator (1) ''spawning'' so that none are born inside the cylinder, and (2) ''motion behaviors'' to avoid this cylinder smoothly while still exhibiting their other natural behaviors '''[2 points]'''.  The cylinder should drawn with solid polygons (not wireframe) in a striped or checkerboard pattern with colors that contrast with the boids.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Add the cylinder as an obstacle in the physics mode, so that it can be collided with. '''[1 point]'''</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Add the cylinder as an obstacle in the physics mode, so that it can be collided with. '''[1 point]'''</div></td></tr>
</table>Cerhttp://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&diff=1121&oldid=prevCer at 04:10, 13 April 20182018-04-13T04:10:58Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='en'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 04:10, 13 April 2018</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l20" >Line 20:</td>
<td colspan="2" class="diff-lineno">Line 20:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* '0': A colored point at the creature's current position, as well as a fading history of recent positions (DRAW_MODE_HISTORY).  The color indicates the current mix of the different behavioral forces on the creature's motion, with the red channel proportional to ''separation'' force, green proportional to ''alignment'', and blue to ''cohesion''.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* '0': A colored point at the creature's current position, as well as a fading history of recent positions (DRAW_MODE_HISTORY).  The color indicates the current mix of the different behavioral forces on the creature's motion, with the red channel proportional to ''separation'' force, green proportional to ''alignment'', and blue to ''cohesion''.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Pressing the 'p' key toggles "physics" mode.  In the template code, odd-numbered presses <del class="diffchange diffchange-inline">causes </del>the flocking to stop and all of the boids to fall under the influence of gravity until they hit the bottom of the box.  Even-numbered presses remove the gravitational force and allow flocking to resume.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Pressing the 'p' key toggles "physics" mode.  In the template code, odd-numbered presses <ins class="diffchange diffchange-inline">cause </ins>the flocking to stop and all of the boids to fall under the influence of gravity until they hit the bottom of the box.  Even-numbered presses remove the gravitational force and allow flocking to resume.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><!--</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><!--</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l44" >Line 44:</td>
<td colspan="2" class="diff-lineno">Line 44:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Modify copy_flocker_states_to_graphics_objects() and copy_graphics_objects_to_flocker_states() in Bullet_Utils.cpp so that 3-D orientation information is properly transferred back and forth between the graphics side and the physics side of the simulation '''[2 points]'''</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Modify copy_flocker_states_to_graphics_objects() and copy_graphics_objects_to_flocker_states() in Bullet_Utils.cpp so that 3-D orientation information is properly transferred back and forth between the graphics side and the physics side of the simulation '''[2 points]'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Draw a vertical cylinder of radius 1 in the center of the box (it should go from floor to ceiling of the box).  Make changes to both Flocker and Predator (1) ''spawning'' so that none are born inside the cylinder, and (2) ''motion behaviors'' to avoid this cylinder smoothly while still exhibiting their other natural behaviors '''[2 points]'''.  The cylinder should drawn with solid polygons (not wireframe) in a striped or checkerboard pattern with colors that contrast with the boids.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* Draw a vertical cylinder of radius 1 in the center of the box (it should go from floor to ceiling of the box).  Make changes to both Flocker and Predator (1) ''spawning'' so that none are born inside the cylinder, and (2) ''motion behaviors'' to avoid this cylinder smoothly while still exhibiting their other natural behaviors '''[2 points]'''.  The cylinder should drawn with solid polygons (not wireframe) in a striped or checkerboard pattern with colors that contrast with the boids.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Add the cylinder as an obstacle in the physics mode, so that it can be collided with.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Add the cylinder as an obstacle in the physics mode, so that it can be collided with. <ins class="diffchange diffchange-inline">'''[1 point]'''</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This is worth '''5 points'''.  The apparent total possible of 20 will be multiplied by 0.75 to make 15 the maximum possible.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>This is worth '''5 points'''.  The apparent total possible of 20 will be multiplied by 0.75 to make 15 the maximum possible.</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l52" >Line 52:</td>
<td colspan="2" class="diff-lineno">Line 52:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The download will unzip to a directory called <tt>bullet_creatures</tt>.  This directory should be placed in the OpenGL tutorials hierarchy at the same level as the other tutorial and playground directories.  To compile the code in it, you will need to target the bullet_creatures directory.   </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The download will unzip to a directory called <tt>bullet_creatures</tt>.  This directory should be placed in the OpenGL tutorials hierarchy at the same level as the other tutorial and playground directories.  To compile the code in it, you will need to target the bullet_creatures directory.   </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>On Ubuntu, this meant modifying <tt>CMakeLists.txt</tt> and running <tt>cmake ..</tt> one time from the <tt>build</tt> directory.  Then <tt>make creatures</tt> and <tt>launch-bullet_creatures.sh</tt> should work.  Here is a link to the modified [https://drive.google.com/<del class="diffchange diffchange-inline">open</del>?<del class="diffchange diffchange-inline">id</del>=<del class="diffchange diffchange-inline">1DFa0QVdgM1aAds3zFUjjdbMn3rcgNz8u </del>CMakeLists.txt] -- let me know if you are still confused about what changes to make.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>On Ubuntu, this meant modifying <tt>CMakeLists.txt</tt> and running <tt>cmake ..</tt> one time from the <tt>build</tt> directory.  Then <tt>make creatures</tt> and <tt>launch-bullet_creatures.sh</tt> should work.  Here is a link to the modified [https://drive.google.com/<ins class="diffchange diffchange-inline">file/d/1rvN4NOCN40xSpAzoqPy4IdLy1pNXHAUZ/view</ins>?<ins class="diffchange diffchange-inline">usp</ins>=<ins class="diffchange diffchange-inline">sharing </ins>CMakeLists.txt] -- let me know if you are still confused about what changes to make.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><!--On Piazza, please post what you need to do for XCode and Visual Studio if it is non-trivial.--></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div><!--On Piazza, please post what you need to do for XCode and Visual Studio if it is non-trivial.--></div></td></tr>
</table>Cerhttp://nameless.cis.udel.edu/class_wiki/index.php?title=CISC440_S2018_HW3&diff=1120&oldid=prevCer: Created page with "''Due Thursday, March 16'' ==Description== This assignment is intended to acquaint you with flocking-type particle systems and physics simulation using the [http://bulletph..."2018-04-13T04:06:48Z<p>Created page with "''Due Thursday, March 16'' ==Description== This assignment is intended to acquaint you with flocking-type particle systems and physics simulation using the [http://bulletph..."</p>
<p><b>New page</b></p><div>''Due Thursday, March 16'' <br />
<br />
==Description==<br />
<br />
This assignment is intended to acquaint you with flocking-type particle systems and physics simulation using the [http://bulletphysics.org/wordpress/ Bullet library]. You are given template code ([https://drive.google.com/file/d/1DFa0QVdgM1aAds3zFUjjdbMn3rcgNz8u/view?usp=sharing bullet_creatures.zip] -- see instructions below) which simulates a simple system of creatures in a 3-D box. A base class ''Creature'' defines a generic boid with no specific behaviors, and the class ''Flocker'' is derived from it which instantiates [http://www.red3d.com/cwr/boids/ Reynolds' flocking rules]. When a creature leaves the box it is "wrapped" to the other side. <br />
<br />
Keyboard shortcuts for camera control:<br />
<br />
* 'a'/'d': Change longitude of "orbital" perspective outside the box<br />
* 'w'/'s': Change latitude of orbital camera view<br />
* 'z'/'c': Zoom in/out<br />
* 'x': Return to default camera view<br />
<br />
Drawing modes for rendering each flocker:<br />
<br />
* Space bar: Pause/unpause simulation<br />
* '7': Textured .obj model (DRAW_MODE_OBJ). Orientations are all identical in the template code. Choose model from "cube", "suzanne", or "banana" via command-line flag (e.g. "bullet_creatures banana")<br />
* '8': Two orthogonal "arrowhead" polygons pointing in the direction of travel (DRAW_MODE_POLY). This is the default<br />
* '9': Just X, Y, and Z axes of the local "frame" of the creature (DRAW_MODE_AXES)<br />
* '0': A colored point at the creature's current position, as well as a fading history of recent positions (DRAW_MODE_HISTORY). The color indicates the current mix of the different behavioral forces on the creature's motion, with the red channel proportional to ''separation'' force, green proportional to ''alignment'', and blue to ''cohesion''.<br />
<br />
Pressing the 'p' key toggles "physics" mode. In the template code, odd-numbered presses causes the flocking to stop and all of the boids to fall under the influence of gravity until they hit the bottom of the box. Even-numbered presses remove the gravitational force and allow flocking to resume.<br />
<br />
<!--<br />
Command-line options:<br />
<br />
* -n: Number of flockers <br />
* -h: Length of position history for each flocker<br />
--><br />
Your job is to make several modifications and additions to the code, detailed below.<br />
<br />
==Required elements==<br />
<br />
* In the empty ''Predator'' class also derived from Creature:<br />
** Fill in its ''draw()'' function such that it can clearly be distinguished from the flockers. This can be as simple as copying flocker drawing code and changing the color scheme (For this and the next item you will also have to make changes in main.cpp to construct ONE Predator object, draw it, and update it) '''[2 points]'''. <br />
** Fill in its ''update()'' function (and make any other necessary modifications to member variables and the constructor) so that it chases flockers based on a ''hunger_force'' '''[3 points]'''<br />
* Modify the Flocker class so that it has a ''fear_force'' that makes it flee from Predators, with high priority, when they get close enough '''[3 points]'''. This does not necessarily need to be pure avoidance---there could be a different (e.g. zigzag) motion mode that is activated.<br />
* Modify Bullet_Utils.cpp so that the ''velocity'' of each flocker is transferred to the corresponding rigid body when switching to physics mode '''[3 points]''', and so that a pair of the ''vertical'' sides of the box become obstacles like the ground '''[3 points]'''<br />
<br />
Please include a README with your submission that briefly explains your approach to the Predator drawing and ''hunger_force'', as well as the Flocker ''fear_force''.<br />
<br />
==Graduate students only==<br />
<br />
* Modify copy_flocker_states_to_graphics_objects() and copy_graphics_objects_to_flocker_states() in Bullet_Utils.cpp so that 3-D orientation information is properly transferred back and forth between the graphics side and the physics side of the simulation '''[2 points]'''<br />
* Draw a vertical cylinder of radius 1 in the center of the box (it should go from floor to ceiling of the box). Make changes to both Flocker and Predator (1) ''spawning'' so that none are born inside the cylinder, and (2) ''motion behaviors'' to avoid this cylinder smoothly while still exhibiting their other natural behaviors '''[2 points]'''. The cylinder should drawn with solid polygons (not wireframe) in a striped or checkerboard pattern with colors that contrast with the boids.<br />
* Add the cylinder as an obstacle in the physics mode, so that it can be collided with.<br />
<br />
This is worth '''5 points'''. The apparent total possible of 20 will be multiplied by 0.75 to make 15 the maximum possible.<br />
<br />
==Install instructions==<br />
<br />
The download will unzip to a directory called <tt>bullet_creatures</tt>. This directory should be placed in the OpenGL tutorials hierarchy at the same level as the other tutorial and playground directories. To compile the code in it, you will need to target the bullet_creatures directory. <br />
<br />
On Ubuntu, this meant modifying <tt>CMakeLists.txt</tt> and running <tt>cmake ..</tt> one time from the <tt>build</tt> directory. Then <tt>make creatures</tt> and <tt>launch-bullet_creatures.sh</tt> should work. Here is a link to the modified [https://drive.google.com/open?id=1DFa0QVdgM1aAds3zFUjjdbMn3rcgNz8u CMakeLists.txt] -- let me know if you are still confused about what changes to make.<br />
<br />
<!--On Piazza, please post what you need to do for XCode and Visual Studio if it is non-trivial.--><br />
<br />
==Submission instructions==<br />
<br />
Submit a zipped version of your modified bullet_creatures directory. Clean it up before submission -- it should only contain .cpp, .hh, and shader files.</div>Cer