Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Compass Example
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default Compass Example - 05-19-2010, 02:45 PM

This is an example of a compass that I created using a rather complex concept of math called Trigonometry. There is also a mouse looking method to let you look around, use arrow keys if you want also. I left the boxes showing so that you can see a little bit how I did this. The box that you first see is North, if you look to the right you will see East, South, and then West, and then North again when you make a 360 turn.

I will release the text compass soon, I am going to start working on it now.
Attached Files
File Type: a2w Compass.a2w (424.6 KB, 19 views)
File Type: a2w Compass(text).a2w (335.6 KB, 9 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301

Last edited by Dameria; 05-24-2010 at 05:41 PM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-19-2010, 06:10 PM

I just created the other compass that another person wanted me to make, it is merely a checker to see which direction you are facing and changes a 3d text to display whether you are facing N, NE, E, SE, S, SW, W, NW depending on which direction you are looking in. This was much easier because I didn't have to use the Law of Cosines (the trigonometry part) that I had to on the other compass and I did not have to worry about the rotation of the needles spinning the right way. They are both very useful however, so here is the "digital" compass
Attached Files
File Type: a2w Compass(text).a2w (335.6 KB, 9 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
shaydon
Senior Member
 
Status: Offline
Posts: 445
Join Date: Dec 2009
Location: Caspian Border
Default 05-19-2010, 06:52 PM

Quote:
Originally Posted by Dameria View Post
I just created the other compass that another person wanted me to make, it is merely a checker to see which direction you are facing and changes a 3d text to display whether you are facing N, NE, E, SE, S, SW, W, NW depending on which direction you are looking in. This was much easier because I didn't have to use the Law of Cosines (the trigonometry part) that I had to on the other compass and I did not have to worry about the rotation of the needles spinning the right way. They are both very useful however, so here is the "digital" compass
this is awesome!!!!
can i use this???
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-19-2010, 08:30 PM

Quote:
Originally Posted by shaydon View Post
this is awesome!!!!
can i use this???
I allow everyone to use the programs that I create. Most of my programs are just examples of how to do little things in a program to make their own programs better. Good luck finding out how I did every small part of this compass (there is a lot of stuff that only I as the creator know, like that I moved each direction exactly 10 meters away from the base, so in the Law of Cosines function it divides by 200. If you use any other number but the 10 away from base and 200, it will not work correctly, however there is an easy way to fix it so it can be any number), stuff like that.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
boppy
Guest
 
Status:
Posts: n/a
Default 05-19-2010, 09:51 PM

This is awesome, but am I correct in assuming that this would work with a flight sim? I ask because the plane will be gaining altitude, rolling, spinning, etc.. Will the compass still be accurate?
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-20-2010, 08:15 AM

Quote:
Originally Posted by boppy View Post
This is awesome, but am I correct in assuming that this would work with a flight sim? I ask because the plane will be gaining altitude, rolling, spinning, etc.. Will the compass still be accurate?
If you want I can see your program and determine how to do it, but I should still be able to find a way to get it to work the same as this compas works, just do the same thing with the base and all the directions and move to airplane, just like what it says in the method for changing the compass.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-24-2010, 05:44 PM

Oh my god, I feel so foolish It seems that I had the compass working backwards the whole time. It took until now (seeing Artyfishl's compass) to notice this, so here it is, I fixed it and now you can redownload it to get the fixed version (all I needed to do was change the turn "right" into turn "left").

For some reason it never occurred to me while making it that a compass's needle is supposed to point north the entire time I feel stupid... Thanks Artyfishl for uploading your version, and I will get that Objectives example working soon (maybe this weekend or earlier).

The new compass is up on top or you can download it on this post (they are both the same world)
Attached Files
File Type: a2w Compass.a2w (424.6 KB, 6 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301

Last edited by Dameria; 05-24-2010 at 08:19 PM.
   
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
Thumbs up 05-25-2010, 11:23 AM

thanks, is my one similar to your one or are they completely different?


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

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-25-2010, 03:24 PM

Quote:
Originally Posted by arty-fishL View Post
thanks, is my one similar to your one or are they completely different?
They are pretty different, but I noticed that on yours, the compass can get stuck on the north part for a split second, and if you fool around with it and turn it long enough you can make the needle face a little bit off of what it is supposed to.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
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
Arrow 05-25-2010, 05:09 PM

Quote:
Originally Posted by Dameria View Post
They are pretty different, but I noticed that on yours, the compass can get stuck on the north part for a split second, and if you fool around with it and turn it long enough you can make the needle face a little bit off of what it is supposed to.
fixed in the new version, it was getting stuck cos the distances were too small and it was returning NaN when trying to invert, so I've moved the points five hundred and something more metres away from the camera, so any problem like that is barely noticeable and it now reloads the position from the reset point every 200 calculations, so it shouldn't go off slightly.


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

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