View Full Version : it is possible to get an object's orientation, but you can not set it?
roofy
09-26-2006, 07:22 AM
Hi there all,
I am a student at Camden County College, taking Fundemental of Computer Programming. As I have been working on a project, I wanted to save an object's orientation so that I could set it back later on. However, I noticed that you can save an object's orientation into a varible but I have not seen a way to set it's orientation back. Is there any way I can set an object's orientation to a value that I have saved as a varible? If not, then what is the purpose for this type of varible if you cannot use it later on?
Mr Nemo
09-26-2006, 08:58 PM
I'm not sure if this will work, but there is an "orient to" command. Perhaps it accepts variables?
roofy
09-28-2006, 04:42 AM
You would think that "orient to" would do the trick, but suprisingly that is not it. Actually "orient to" uses an object reference. Thanks for trying though.
Any other ideas?
DrJim
09-28-2006, 01:31 PM
Alice uses a combination of two values, position and orientation to describe an objects location in World space. These are defined data types, can be used as variables and parameters, and can be printed out while running a world. What actually is listed in the parameter table is the "point of view" of an object, which is a combination of these two parameters.
The only way I have found to set these is by referencing them to an existing object that is positioned the way you want it. This isn't, for me at least, a real problem because I have no idea (right now) how to figure out the orientation parameter even if you could set it directly.
Note that you don't have to clutter up the screen with a lot of dummy objects, just make lists of the parameters you want to set, add items to the list (by moving an object and copying it's position/orientation as list paramers) and then use the items in the lists in your "set --- to" commands.
Also note that (1) I've only done limited testing of this trick and (2) this explaination is probably oversimplified. I'm working on something cleaner but it probably will take a couple of weeks. Hope this will get you going in the meantime.
Jim
roofy
09-28-2006, 06:01 PM
DrJim,
I am night quite understanding you. Please excuse me for I am only just begining to learn about parameters, basic functions and some varibles. Our class is still doing very basic stuff in their projects.
Mr Nemo
09-28-2006, 10:12 PM
The attached world has some code that I think will do the trick.