I have a 256 by 256 billboard with a rotating circle in it. When the circle has a radius greater than 75 you will notice parts of the circle appear in the corners of the billboard.
I'm not sure why this is happening, but I was hoping someone could explain this to me.
Any help is appreciated.
Code: Select all
;PRESS Escape to exit
#CameraSpeed = 1
Define.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()
ExamineDesktops()
Width=DesktopWidth(0)
Height=DesktopHeight(0)
OpenWindow(0, 0, 0, Width, Height, "Billboard Test")
OpenWindowedScreen(WindowID(0), 0, 0, Width, Height, 0, 0, 0)
CircleRadius=120
Texture=CreateTexture(#PB_Any,256,256)
StartDrawing(TextureOutput(Texture))
DrawingMode(#PB_2DDrawing_AllChannels | #PB_2DDrawing_AlphaBlend)
Circle(128,128,CircleRadius,RGBA(255,0,0,255))
StopDrawing()
Material=CreateMaterial(#PB_Any, TextureID(Texture))
DisableMaterialLighting(Material, 1)
MaterialBlendingMode(Material, #PB_Material_AlphaBlend)
RotateMaterial(Material, 0.1, #PB_Material_Animated)
BillboardGroup=CreateBillboardGroup(#PB_Any, MaterialID(Material), 256, 256,0,0,0)
Billboard1=AddBillboard(#PB_Any, BillboardGroup, 50, 0, 0)
Camera=CreateCamera(#PB_Any, 0, 0, 100, 100)
MoveCamera(Camera, 0, 0, 500, #PB_Absolute)
CameraBackColor(Camera,RGB(50,50,50))
Repeat
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)
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf
End

