Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Comprehensive Explanation Needed (http://www.alice.org/community/showthread.php?t=1975)

 x2495iiii 12-02-2008 04:36 PM

Comprehensive Explanation Needed

I have been working with Alice for quite some time and I've scoured the textbook I have and have not found any explanation as to how some of the built-in functions in Alice work. Could someone explain:
World Functions
1. mouse distance from left edge/top edge (tried to use but didn't understand how numbers were calculated)
2. IEEE Remainder of A/B (probably some math I haven't learned yet)
Object Functions
1. Object's quaternion (????)
2. object's part named key (does that have to do with subparts?)
3. object's variable named variablename and of class valueclass
Also, all of the seldomly used properties for objects would be nice, especially specular highlight exponent

 DrJim 12-02-2008 07:13 PM

Functions and Seldom Used Properties

This is just off the top of my head to get you started - and may not be totally correct. It should, however, give you a start to experiment with. It's also probably worth searching the forum and Dick Baldwin's tutorials for more definitive answers.

[I]World Functions
1. mouse distance from left edge/top edge (tried to use but didn't understand how numbers were calculated)[/I]

This is just the distance the cursor is from the top left edge of the viewing window in pixels. Note values outside the viewing window are allowed.

[I]2. IEEE Remainder of A/B (probably some math I haven't learned yet)[/I]

Nothing I'd worry about. It refers to an IEEE standard for floating point math but probably won't be too significant with modern machines. Basically it handles things like 4/3 = 1 1/3 = 1.3333333.... (very messy when one was working with 8-bit machines and big numbers :rolleyes:)

Essentially the same as the more conventional (x,y,z) coordinates. There are a couple of good forum postings on this.

[I]Object Functions

1. Object's quaternion (????)[/I]

A complex notation for 3-dimensional movement which is widely used in games. Wikipedia has a good article as a starting point for information. I really don't think you can use them within Alice 2.0 very effectively - suspect they were included for debug.

[I]2. object's part named key (does that have to do with subparts?)
3. object's variable named variablename and of class valueclass[/I]

Both of these can be used to pass parameters to methods. They can be a bit tricky to use as all of the names have to be exact! I believe there is an example in the Dunn, et al text.

[I]Also, all of the seldomly used properties for objects would be nice, especially specular highlight exponent.[/I]

The first few are pretty self explanatory.

"is First Class" determines whether or not an object can be selected by the mouse - very useful for something like the ground that you don't want to select.

"Emmisive color" is the color of light [B]coming from[/B] an object (like a glowing ball).

"Spectral Highlights" refers to light from other sources [B]reflected from[/B] the an object. The color is a combination of the selected color and the color of the source while the exponent sets the intensity of the reflection. Experimenting here is the best approach, although there are tutorials on the web.

Both emmisive color and the spectral parameters, as well as flat vs. smooth shading (experiment with these also) are subsets of the general subject of rendering 3D objects - most 3D modeling programs go into these in some detail. Blender has some of the best tutorials - but they can be pretty difficullt to follow.

I have no idea what "eventsStopAscending" does. :confused: (Anyone?)

An opacity map should allow you to modify a texture with a second image but I've never figured out how to make it work.

As I said at the beginning, this is just a first pass. Additions and corrections are welcome and encouraged. :)

Added note: Just after I posted this, a mouse control program that illustrates the first function was posted - see [url]http://www.alice.org/community/showthread.php?t=1931[/url] .

 x2495iiii 12-02-2008 09:50 PM

i tried to experiment with is pivot showing, but it didn't change anything visibly

also, i tried using right,up,forward, but it wont go anywhere. what methods/functions accept it?

otherwise this was excellent help thank you Dr. Jim

 DrJim 12-03-2008 04:01 PM

1 Attachment(s)
The attached example should help with both issues.

1. It moves the chicken using right,up and forward coordinates. You can add an "as seen by" reference to make the coordinates absolute but I don't remember the exact details (either the ground or the world sets the (0,0,0) cordinate reference). A forum search on offset or something similar should find it and I think there is an explaination in Dick Baldwin's tutorials - or it's not too hard to figure out with a couple of experiments.

2. I also toggled viewing a pivot (origin and axis) on and off. This works fine on a PC but I believe the axis are not visable on a Mac for Alice 2.0 - though I think this is fixed in 2.2b

 x2495iiii 12-03-2008 09:56 PM

strange, I'm not using a Mac (I hate Macs, but that's neither here nor there)

and I actually have another question: Is there any way to include audio clips in Alice 2.2 in such a way so as not to freeze the video when the clip is played?

I've included music and small sound effects before with no problems, but for some reason it froze when i tried to have it play a voiceover for a character. The file is in .wav format and is only 28 seconds long...

 DrJim 12-04-2008 08:47 PM

Audio in Alice

Personally I gave up on trying to do any audio other than the very basic stuff in Alice (actuallly this was also the recommended approach in the first edition of the Dunn, et al text). The timing never seems to work right and for videos I usually use a screen capture program and go into a movie editor anyway.

You might look at a program called music box that was posted in the forum a while back. Think it solved some of the problems.

 x2495iiii 12-05-2008 02:14 AM

Yeah I actually just finished a very large movie (31+MB i think, not sure as i am half asleep) and exported it into Microsoft moviemaker so I could add voiceovers to the characters. That was fun and easy, I recommend it to anyone having any problems with Alice 2.2.

Also, has anyone came up with the solution to the "Unable to load world" bug yet? I had it happen to my movie and checked the forums for help and got nothing but a bunch of people who had the same thing happen to them. Fortunately, I got some help fixing it (from Dennis Cosgrove himself!), but I also came up with a way to fix the glitch later.

Unzip the .a2w file with the error (I used 7-zip) and save the contents to a folder. Check inside the folder to see all of the objects and methods used by your world, and simply analyze the error message Alice gives you to find the offending method or object and delete the folder with that method/object in it. Finally, zip-up the folder and run it using Alice, the world should now load, but with the components in the folders you deleted gone. (A small sacrifice compared to the loss of the entire program).

 jediaction 04-21-2011 05:27 PM

 reuben2011 04-21-2011 07:19 PM

I know this is a really old thread but x2495iiii, did you get all your questions answered? :o

 x2495iiii 04-22-2011 11:49 PM