Lionheart008
30-12-2009, 14:31
good morning!
I am looking for the tbgl example here at the board (petr has done it?), where I can see some "matrix" effects for characters/letters dropping down from the top. Didn't found it. I found some letters for this "matrix effect", but not the special tbgl example (with "tbgl_font.bmp") as background so far as I can remember.
next: have done little play with blur texteffect, it's not new, but I like it and perhaps I can use this effect for my idea with matrix effects and all characters there. of course I have to adept this example with tbgl_entities mode, will come next days/week.
' frankos_Basic bluring effect
Uses "TBGL"
Uses "UI"
Dim hWnd As DWord
Dim cx As Integer
Dim cy As Integer
hWnd = TBGL_CreateWindowEx(" => test_bEffect - press ESC to quit, today: " + Date$, 1024, 768,32, %TBGL_WS_CLOSEBOX or %TBGL_WS_MaximizeBox or %TBGL_WS_MinimizeBox)
TBGL_ShowWindow
'TBGL_LoadTexture "Textures\Effect1abc.bmp", 1, %TBGL_TEX_MIPMAP
TBGL_LOADTEXTURE "Textures\M.bmp", 1, %TBGL_TEX_MIPMAP
TBGL_UseTexture 1 ' We will turn texturing on
TBGL_BindTexture 1 ' We will use texture 0
GetAsyncKeyState(%VK_ESCAPE) ' Resets ESC key status before checking
tbgl_UseDepthMask 0
TBGL_UseBlend 1
TBGL_UseBlend 2
'----------------------------------
Dim FrameRate As Single
dim i as long
Dim BlurFactor As Long = 48'32'64
dim R, G, B as long
Dim actualImage As Long = 1
dim actualImageAngle as single = 0
dim oldImageAngle(BlurFactor) as single = 0
R = rnd(0,255)
G = rnd(0,255)
B = rnd(0,255)
While IsWindow(hWnd)
FrameRate = TBGL_GetFrameRate
tbgl_ClearFrame
TBGL_Camera 0,0,7,0,0,0
actualImageAngle += 126 / FrameRate '96
ActualizeBlur(actualImageAngle)
if actualImageAngle > 180 then
ResetBlur
actualImage += 1
actualImageAngle = 0
R = rnd(0,255)
G = rnd(0,255)
B = rnd(0,255)
end if
for i = 1 to BlurFactor
tbgl_PushMatrix
tbgl_Rotate 180+oldImageAngle(i),0,0,1
tbgl_Scale 1+oldImageAngle(i)/45, 1+oldImageAngle(i)/45, 1
tbgl_Color R/i, G/i, B/i
DrawTextLineFromBMP(actualImage, 3)
sleep 10
tbgl_PopMatrix
next
tbgl_DrawFrame
If GetWindowKeyState( hWnd, %VK_ESCAPE) Then Exit While
Wend
TBGL_DestroyWindow
sub DrawTextLineFromBMP( nLine as long, numLines as long ) ' which line of how many
Local oneLineSize As Single = 2 / numLines
tbgl_BeginPoly %GL_QUADS
TBGL_TexCoord2D 0, 2 -(oneLineSize*(nLine-2))
TBGL_Vertex -2, oneLineSize, 0
TBGL_TexCoord2D 2, 2-(oneLineSize*(nLine-2))
TBGL_Vertex 2, oneLineSize, 0
TBGL_TexCoord2D 2, 2-(oneLineSize*nLine)
TBGL_Vertex 2, -oneLineSize, 0
TBGL_TexCoord2D 0, 2-(oneLineSize*nLine)
TBGL_Vertex -2, -oneLineSize, 0
tbgl_EndPoly
end sub
sub ActualizeBlur( bValue as single )
local j as long
for j = BlurFactor-1 to 1 step -1
oldImageAngle(j+1) = oldImageAngle(j)
next
oldImageAngle(1) = bValue
end sub
sub ResetBlur()
local j as long
for j = 1 to BlurFactor
oldImageAngle(j) = 0
next
end sub
thanks, nice day to all frank
I am looking for the tbgl example here at the board (petr has done it?), where I can see some "matrix" effects for characters/letters dropping down from the top. Didn't found it. I found some letters for this "matrix effect", but not the special tbgl example (with "tbgl_font.bmp") as background so far as I can remember.
next: have done little play with blur texteffect, it's not new, but I like it and perhaps I can use this effect for my idea with matrix effects and all characters there. of course I have to adept this example with tbgl_entities mode, will come next days/week.
' frankos_Basic bluring effect
Uses "TBGL"
Uses "UI"
Dim hWnd As DWord
Dim cx As Integer
Dim cy As Integer
hWnd = TBGL_CreateWindowEx(" => test_bEffect - press ESC to quit, today: " + Date$, 1024, 768,32, %TBGL_WS_CLOSEBOX or %TBGL_WS_MaximizeBox or %TBGL_WS_MinimizeBox)
TBGL_ShowWindow
'TBGL_LoadTexture "Textures\Effect1abc.bmp", 1, %TBGL_TEX_MIPMAP
TBGL_LOADTEXTURE "Textures\M.bmp", 1, %TBGL_TEX_MIPMAP
TBGL_UseTexture 1 ' We will turn texturing on
TBGL_BindTexture 1 ' We will use texture 0
GetAsyncKeyState(%VK_ESCAPE) ' Resets ESC key status before checking
tbgl_UseDepthMask 0
TBGL_UseBlend 1
TBGL_UseBlend 2
'----------------------------------
Dim FrameRate As Single
dim i as long
Dim BlurFactor As Long = 48'32'64
dim R, G, B as long
Dim actualImage As Long = 1
dim actualImageAngle as single = 0
dim oldImageAngle(BlurFactor) as single = 0
R = rnd(0,255)
G = rnd(0,255)
B = rnd(0,255)
While IsWindow(hWnd)
FrameRate = TBGL_GetFrameRate
tbgl_ClearFrame
TBGL_Camera 0,0,7,0,0,0
actualImageAngle += 126 / FrameRate '96
ActualizeBlur(actualImageAngle)
if actualImageAngle > 180 then
ResetBlur
actualImage += 1
actualImageAngle = 0
R = rnd(0,255)
G = rnd(0,255)
B = rnd(0,255)
end if
for i = 1 to BlurFactor
tbgl_PushMatrix
tbgl_Rotate 180+oldImageAngle(i),0,0,1
tbgl_Scale 1+oldImageAngle(i)/45, 1+oldImageAngle(i)/45, 1
tbgl_Color R/i, G/i, B/i
DrawTextLineFromBMP(actualImage, 3)
sleep 10
tbgl_PopMatrix
next
tbgl_DrawFrame
If GetWindowKeyState( hWnd, %VK_ESCAPE) Then Exit While
Wend
TBGL_DestroyWindow
sub DrawTextLineFromBMP( nLine as long, numLines as long ) ' which line of how many
Local oneLineSize As Single = 2 / numLines
tbgl_BeginPoly %GL_QUADS
TBGL_TexCoord2D 0, 2 -(oneLineSize*(nLine-2))
TBGL_Vertex -2, oneLineSize, 0
TBGL_TexCoord2D 2, 2-(oneLineSize*(nLine-2))
TBGL_Vertex 2, oneLineSize, 0
TBGL_TexCoord2D 2, 2-(oneLineSize*nLine)
TBGL_Vertex 2, -oneLineSize, 0
TBGL_TexCoord2D 0, 2-(oneLineSize*nLine)
TBGL_Vertex -2, -oneLineSize, 0
tbgl_EndPoly
end sub
sub ActualizeBlur( bValue as single )
local j as long
for j = BlurFactor-1 to 1 step -1
oldImageAngle(j+1) = oldImageAngle(j)
next
oldImageAngle(1) = bValue
end sub
sub ResetBlur()
local j as long
for j = 1 to BlurFactor
oldImageAngle(j) = 0
next
end sub
thanks, nice day to all frank