Try this. Using scripts can solve a lot of issues.
Alpha script: Save file to a folder named "script" - Filename: somefilename.material
Code: Select all
//PNG with alpha blend
material BILLB
{
technique
{
pass
{
depth_check off
separate_scene_blend alpha_blend modulate
texture_unit
{
texture grass1.png
}
}
}
}
Code: Select all
#CameraSpeed = 1
Define.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(0, 0, 0, 800, 600, "Bill is on the board", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive("script", #PB_3DArchive_FileSystem)
Parse3DScripts()
Material = GetScriptMaterial(#PB_Any, "BILLB")
If Material = 0
Debug "error - Material not loaded!"
EndIf
Billboard = CreateBillboardGroup(#PB_Any, MaterialID(Material), 10, 10, -20, 0, -40)
AddBillboard(Billboard, 0, 0, 0)
AddBillboard(Billboard, 0, 0, 40)
AddBillboard(Billboard, 0, 0, 80)
Camera = CreateCamera(#PB_Any, 0, 0, 100, 100)
CameraBackColor(Camera, $EB8E57)
Repeat
Repeat
ev = WindowEvent()
Until ev = 0
If ExamineMouse()
MouseX = -MouseDeltaX() * #CameraSpeed * 0.05
MouseY = -MouseDeltaY() * #CameraSpeed * 0.05
EndIf
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -#CameraSpeed
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = #CameraSpeed
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -#CameraSpeed
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = #CameraSpeed
Else
KeyY = 0
EndIf
EndIf
RotateCamera(Camera, MouseY, MouseX, 0, #PB_Relative)
MoveCamera(Camera, KeyX, 0, KeyY)
RenderWorld()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End