Alice Community  

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

Reply
 
Thread Tools Display Modes
Old
LahDeeDah
Guest
 
Status:
Posts: n/a
Default 05-18-2008, 01:08 PM

Quote:
Originally Posted by scarlet View Post
You can work with (x,y,z) directly! For example:

PostionA is a vector variable, Dragon is an object.

let PositionA= (3,5,7)

Dragon move to Word, Offset by= PositionA

That line of code should move the Dragon to (3,5,7)! Thanks Dick BALDWIN
Thanks for the responses everyone. I've found this topic to be very frustrating and my student's patience is growing thin as I try to figure this out. The idea that I can declare a POV variable and then not manipulate it is frustrating. I like the idea of decalring a vector but I'd love to then be able to cast the vector to a POV. I can live with the Dragon move to Word, Offset by= PositionA approach but I don't see an Offset method to the "move to" method. Am I missing something? When I click on "more" I see duartion, style, and position but none off them allow me to define an offset.

Yes, I recognize that others have suggested dropping hidden objects around the world but this is not desireable for a few reasons: 1) In the real programming world this would be done using variables and 2) What I'm trying to do is have one object follow another around the screen. So I want to be able to move object 2 to a place relative to object 1 and I can't anticipate in advance everywhere that object 1 might go.
Thanks for any help you can provide.

Last edited by LahDeeDah; 05-18-2008 at 01:21 PM.
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 05-23-2008, 12:44 PM

Quote:
Originally Posted by LahDeeDah View Post
I don't see an Offset method to the "move to" method. Am I missing something?
This is one I always have trouble remembering since I don't find the overall move to position function very useful. The attached photo shows how you get the "offset by =" part of the command - basically the words just appear when you select the "position" option and choose a value. (Also note that the basic "move to" is always to the world, which is the reference for the (0,0,0) point.)

I also attached a short program for a single "move to a point" demonstration. It's about as simple as you can get and still a bit ugly - hopefully this will improve in Alice 3.0. If I was going to do a lot of work with coordinates, I'd probably make a fairly simple world level function of this code which would simplify things a bit.

You may also want to look at the demo programs referenced in Dick Baldwin's postings, which also cover orientation and POV (which is the combination of position and orientation). Finally, you might want to try using the "right,up,forward" world level function which I did not use in the example code.
Attached Images
File Type: jpg offset by input.JPG (32.0 KB, 72 views)
Attached Files
File Type: a2w MoveToPoint.a2w (352.4 KB, 91 views)

Last edited by DrJim; 05-23-2008 at 12:51 PM. Reason: Added reference to world level function
   
Reply With Quote
Reply

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 ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.