Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Completely lost.....
Posts: n/a
Default Completely lost..... - 02-07-2009, 11:28 AM

New to Alice, had a in my lab for the class the other day and now 3 days after I failed to complete the work in class I am still racking my brain. This is no longer for a grade, only for future reference.

Our TA designed a program that had a kangaroo hop twice and land on a box. The initial distance from the kangaroo to the box is set to 6 meters. Each hop covers 2 meters and the landing covers 2 meters. I have to create a variable that allows the hops and landing to cover the right distance regardless of the position of the box from the kangaroo.

Any help would be greatly appreciated.
Reply With Quote
Posts: n/a
Default 02-07-2009, 08:43 PM

Actually not a trivial problem, though it looks easy at first glance. Perhaps the attached will help - though don't be surprised if it doesn't work without some tweaks. Also don't hesitate to ask your TA for help.

The variable part is simple in principle - just use the distance to function divided by three. Catch 1 - "distance to" is always measured from an objects local axis origin - which is defined differently for different objects - so make sure you know where that point is for the pair of objects you are using.

Catch 2 - you need to use the "turn to face" command rather than the point at command if you are going to use the "move forward" command. The Dunn, et al text has a nice example showing the difference.

Catch 3 is similar to the first - you need to make sure that the up directions for the two objects is the same. (It really doesn't matter for the cube - but does if you use the box shape or something similar.)

Good luck.
Attached Files
File Type: a2w Kanga Hop.a2w (364.9 KB, 44 views)
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.