| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>Load3DSound ( file$ )</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- file$ - filename of sound file to be loaded and used as 3D sound
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Loads a sound and returns its handle for use with EmitSound.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/Load3DSound.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; Load3DSound Example
<br />
- ; -------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
- PositionEntity camera,0,1,-10
<br />
-
<br />
- light=CreateLight()
<br />
- RotateEntity light,90,0,0
<br />
-
<br />
- plane=CreatePlane()
<br />
- ground_tex=LoadTexture("media/Chorme-2.bmp")
<br />
- EntityTexture plane,ground_tex
<br />
-
<br />
- cube=CreateCube()
<br />
- cube_tex=LoadTexture("media/b3dlogo.jpg")
<br />
- EntityTexture cube,cube_tex
<br />
- PositionEntity cube,0,1,0
<br />
-
<br />
- microphone=CreateListener(camera) ; Create listener, make it child of camera
<br />
- sound=Load3DSound("media/ufo.wav") ; Load 3D sound
<br />
-
<br />
- While Not KeyDown(1)
<br />
-
<br />
- If KeyDown(205)=True Then TurnEntity camera,0,-1,0
<br />
- If KeyDown(203)=True Then TurnEntity camera,0,1,0
<br />
- If KeyDown(208)=True Then MoveEntity camera,0,0,-0.05
<br />
- If KeyDown(200)=True Then MoveEntity camera,0,0,0.05
<br />
-
<br />
- ; If left mouse button hit then emit sound from cube
<br />
- If MouseHit(1) = True Then EmitSound(sound,cube)
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor keys to move about"
<br />
- Text 0,20,"Press left mouse button to make a sound be emitted from the cube"
<br />
-
<br />
- Flip
<br />
-
<br />
- Wend
<br />
-
<br />
- End
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Load3DSound&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|