Alice Community turn to face away from camera?

 turn to face away from camera?
 krautfed Junior Member   Status: Offline Posts: 2 Join Date: Apr 2012 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?
 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 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.
 Its much easier than that
arty-fishL
Senior Member

Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Its much easier than that - 04-22-2012, 10:25 AM

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

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

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬

krautfed
Junior Member

Status: Offline
Posts: 2
Join Date: Apr 2012
04-22-2012, 01:07 PM

Quote:
 Originally Posted by arty-fishL 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?

 Mr Kidnapper Senior Member   Status: Offline Posts: 442 Join Date: Feb 2011 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.
arty-fishL
Senior Member

Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
04-22-2012, 07:11 PM

Quote:
 Originally Posted by Mr Kidnapper 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 [¬º-°]¬

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops     Alice Player and VR General Discussion     Questions and Comments     The Lounge