From a6abfd2da66bb04739dcddf13d9dc382c1d1b831 Mon Sep 17 00:00:00 2001 From: athomas Date: Sun, 29 Jun 2003 02:42:53 +0000 Subject: set paragraph alignment to "justify" git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/svn-server-sync-demos/joal-demos/trunk@23 235fdd13-0e8c-4fed-b5ee-0a390d04b286 --- www/devmaster/lesson2.html | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'www/devmaster/lesson2.html') diff --git a/www/devmaster/lesson2.html b/www/devmaster/lesson2.html index a70ef71..68c05e1 100644 --- a/www/devmaster/lesson2.html +++ b/www/devmaster/lesson2.html @@ -37,7 +37,7 @@ Fade-away
Maurais
Adapted for Java By: Athomas Goldberg

-

Hope you found the last tutorial of some use. I know I did. This will be a +

Hope you found the last tutorial of some use. I know I did. This will be a real quick and easy tutorial. It won't get too much more complicated at this point.

@@ -58,8 +58,9 @@ point.

static float[] listenerOri = { 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f }; static AL al; static ALC alc;

-

There is only one change in the code since the last tutorial in this fist -section. It is that we altered the sources velocity. It's 'z' field is now 0.1.

+

There is only one change in the code since the last tutorial + in this fist section. It is that we altered the sources velocity. It's 'z' field + is now 0.1.

     static int loadALData() {
         if (al.alGetError() != AL.AL_NO_ERROR) {
@@ -99,10 +100,11 @@ section. It is that we altered the sources velocity. It's 'z' field is now 0.1.<
         }
         return AL.AL_TRUE;
     }
-

Two changes in this section. First we are loading the file "Footsteps.wav". - We are also explicitly setting the sources 'AL_LOOPING' value to 'AL_TRUE'. - What this means is that when the source is prompted to play it will continue - to play until stopped. It will play over again after the sound clip has ended.

+

Two changes in this section. First we are loading the file + "Footsteps.wav". We are also explicitly setting the sources 'AL_LOOPING' + value to 'AL_TRUE'. What this means is that when the source is prompted to play + it will continue to play until stopped. It will play over again after the sound + clip has ended.

     static void setListenerValues() {
         al.alListenerfv(AL.AL_POSITION,	listenerPos);
@@ -149,12 +151,13 @@ section. It is that we altered the sources velocity. It's 'z' field is now 0.1.<
         ALut.alutExit();
     }
 }
-

The only thing that has changed in this code is the loop. Instead of playing -and stopping the audio sample it will slowly get quieter as the sources position -grows more distant. We do this by slowly incrementing the position by it's -velocity over time. The time is sampled by checking the system clock which gives -us a tick count. It shouldn't be necessary to change this, but if the audio clip -fades too fast you might want to change 100 to some higher number.

+

The only thing that has changed in this code is the loop. Instead + of playing and stopping the audio sample it will slowly get quieter as the sources + position grows more distant. We do this by slowly incrementing the position + by it's velocity over time. The time is sampled by checking the system clock + which gives us a tick count. It shouldn't be necessary to change this, but if + the audio clip fades too fast you might want to change 100 to some higher number. +

Download the Java Source and Ant Build file.

-- cgit v1.2.3