alice-teacher Looking To Restrict Character Within Coordinate Boundaries in Alice 3

Donald Slater djslater107 at mac.com
Mon Mar 1 13:00:11 EST 2021


Alice does not provide explicit access to the virtual world’s underlying coordinate system anywhere but in Scene Setup. That being said, by setting an object as a reference point somewhere in your scene and using the distanceTo function of an object you will be able to make sure the object stays within your predetermined boundaries (radius from threference.

I have attached a world, ReferencePoint as demonstration. The program uses a Disc shape as the reference point. It moves and orients the disc to the ground (0,0,0) in the underlying coordinate system, and then sets its opacity to 0.0. (I would normally set this in the Scene Setup). The alien checks its distance from the disc and reports what it has found out. Then the alien moves to the disc, then moves away from the disc until it is more than 5>0 meters away, turns around and comes back. 

Also demonstrated in this world is the exitViewListener event (click on the initializeEvents tab) which will trigger a response whenever an object or objects exits the camera view. Of course this will not work if the object is moving away from the camera and stays within frame, but it is handy for keeping objects from moving off the left and right edges of the screen.

Please let us know if you have any other questions.

All the best,
Don Slater

Alice Project


 

> On Feb 28, 2021, at 11:06 PM, Barnum, William via alice-teachers <alice-teachers at lists.andrew.cmu.edu> wrote:
> 
> Hey everyone,
> 
> I'm looking to restrict a character to within some coordinate boundaries within an Alice 3 program.
> 
> Since there isn't a way to pull coordinate data from an object while running the program, I'm trying to find a workaround, but everything I've come up with feels like a kludge.
> 
> Does anyone have any reasonably elegant way to do this?
> 
> Thanks,
> Bill
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20210301/56b59a1c/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReferencePoint.a3p
Type: application/octet-stream
Size: 236118 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20210301/56b59a1c/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20210301/56b59a1c/attachment-0003.html>


More information about the alice-teachers mailing list