Alice Community  

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

Reply
 
Thread Tools Display Modes
turn to face away from camera?
Old
krautfed
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Default turn to face away from camera? - 04-21-2012, 11:25 PM

I am a beginner and the only way I know to do this is:
OBJECT turn to face CAMERA
OBJECT turn LEFT 0.5 REVOLUTIONS DURATION = 0 SECS

...however obviously this isn't the smooth "turn to face" that I can use whenever there's an object. Is there any way to do this simply?
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 04-22-2012, 03:21 AM

Programmer style solutions eh. There's no real nice way to get the current object's orientation in relation to another object, which might be a good feature to ask for. I in fact have used a (similar) feature like this a few times in simulating raycasting.

Use math to do this. Use trigonometric functions—I like to use arctan (Inverse Tangent)—to solve for the angle of the object relative to the target. The related functions are "Object's distance" in front, as well as to the left of, "Target". This is for retrieving the angle in the XY direction. If you want to solve for the Z angle, you use a separate trigonometric function using the object's distance in front and the distance above the target.

You then subtract this number by 2pi (or 180º if in degrees)—or perhaps the other way around, I don't remember—to recieve the angle it takes to rotate to be considered turned "away from" the target, that is, 180º in relation to the target.

Then you have to remember that Alice calculates everything in percent-decimal, so you have to divide the output angle by 2pi if you're in radians, or 360 if you're in degrees. It's radians by default.

Congrats. You made a method to face away from the target. You can use this method (You should use parameters) with the camera as a target just as well as any other object.
   
Reply With Quote
Its much easier than that
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default Its much easier than that - 04-22-2012, 10:25 AM

Can you not just use "turn away from"?
Check attached example.
Attached Files
File Type: a2w turnAwayFrom.a2w (832.3 KB, 4 views)


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
krautfed
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Default 04-22-2012, 01:07 PM

Quote:
Originally Posted by arty-fishL View Post
Can you not just use "turn away from"?
Check attached example.
Pardon my noobness, but is that a method? How do I get to "turn away from" for an object?
   
Reply With Quote
Old
Mr Kidnapper
Senior Member
 
Status: Offline
Posts: 442
Join Date: Feb 2011
Default 04-22-2012, 01:39 PM

I don't know man I think you're starting to confuse your fancy hacked Alice with vanilla Alice. There is no method like that in vanilla Alice.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 04-22-2012, 07:11 PM

Quote:
Originally Posted by Mr Kidnapper View Post
I don't know man I think you're starting to confuse your fancy hacked Alice with vanilla Alice. There is no method like that in vanilla Alice.
Oh, well there should be, I don't know why they would ever not add it. Since it is actually a feature that exists within the code and is easy to enable, perhaps it will be added in an update.

For now you can get this function through a special mod I just posted:
Alice Style Mods


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.