1
Projects / Re: P.O.V 125 Remake
« on: April 24, 2014 »
I love this good old day's 
Good one!!!
Cheers C3lt1c

Good one!!!
Cheers C3lt1c
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.







'C3lt1cs Software 3D Text_Scroller Sample
#Include "fbgfx.bi"
Dim Shared screen_width As Integer = 450
Dim shared screen_height As Integer = 400
ScreenRes screen_width,screen_height,32,,FB.GFX_SHAPED_WINDOW or FB.GFX_ALWAYS_ON_TOP
Dim Shared draw_screen As UByte Ptr
draw_screen = ImageCreate(screen_width,screen_height,32)
''--------------------------------
Declare Sub view_fps()
Dim Shared fps_counter As Integer = 0
Dim Shared fps_timer As Integer
Dim Shared fps As Integer = 0
fps_timer = Timer
'---------------------------------
Type Vector3D
x As Single
y As Single
z As Single
End Type
Type Pixel
x As Single
y As Single
End Type
Declare Sub s3d_calc_3d(point3d As Vector3D, point3d_calc As pixel)
Declare Sub s3d_scale(point3d As Vector3D, x As Single, y As Single, z As single)
Declare Sub s3d_move(point3d As Vector3D, x As Single, y As Single, z As Single)
Declare Sub rotate_x (obj As Vector3D, beta As Single)
Declare Sub rotate_y (obj As Vector3D, gamma As Single)
Declare Sub rotate_z (obj As Vector3D, _Alpha As Single)
Dim Shared DEGtoRAD As Single
DEGtoRAD = 3.141593 / 180
Dim Shared eye As Vector3D
'---------------------------------
Dim shared text As String
text = "C3LT1C IS BACK MY BROTHERS "
Dim Shared text_length As Integer
text_length = Len(text) * 7
Dim Shared pixel_counter As Integer
Dim Shared kugel_counter As Integer
Dim text_buf_img As UByte Ptr = ImageCreate(8, text_length*2,RGB(0,0,100))
For i As Integer = 0 To Len(text)
Draw String text_buf_img,(0,i*8),Mid(text,i+1,1)
Next
For x As Integer = 0 To 7
For y As Integer = 0 To text_length
pixel_counter + = 1
Next
Next
kugel_counter = pixel_counter
Dim Shared kugel_cpy(pixel_counter) As Vector3D
Dim Shared kugel(pixel_counter) As Vector3D
Dim Shared kugel_draw_array(pixel_counter) As Integer
Dim Shared pixel_data As Pixel
Dim Shared rotate As Single
Dim Shared move As Single
pixel_counter = 0
For x As Integer = -3 To 4
For y As Integer = 0 To text_length
kugel_cpy(pixel_counter).x = x
kugel_cpy(pixel_counter).y = y
kugel_cpy(pixel_counter).z = 0
pixel_counter + = 1
Next
Next
pixel_counter = 0
For x As Integer = 0 To 7
For y As Integer = 0 To text_length
If Point(x,y,text_buf_img) = &hFFFFFFFF Then
kugel_draw_array(pixel_counter) = 1
Else
kugel_draw_array(pixel_counter) = 0
EndIf
pixel_counter + = 1
Next
Next
eye.x = 0
eye.y = 0
eye.z = 200
'---------------------------------
Do
Line draw_screen,(0,0)-(screen_width,screen_height),0,bf
For i As Integer = 0 to kugel_counter
kugel(i).x = kugel_cpy(i).x
kugel(i).y = kugel_cpy(i).y
kugel(i).z = kugel_cpy(i).z
s3d_scale(kugel(i), 10, 10, 1)
rotate_x(kugel(i),180)
rotate_y(kugel(i),rotate)
s3d_move(kugel(i), 0, move, 0)
s3d_calc_3d(kugel(i), pixel_data)
If kugel_draw_array(i) = 1 Then
Circle draw_screen ,(pixel_data.x, pixel_data.y),3,RGB(255,0,0),,,,f
EndIf
'PSet draw_screen, (pixel_data.x, pixel_data.y),RGB(255,0,0)
Next
move += 1
rotate += 1
view_fps()
ScreenLock
Cls
Put(0,0),draw_screen
ScreenUnLock
Sleep 10
Loop Until InKey = Chr(27)
ImageDestroy text_buf_img
ImageDestroy draw_screen
End
Sub view_fps()
'FPS Anzeige
Draw String draw_screen,(0,220),"FPS: " & Str(fps)
fps_counter += 1
'fps counter
If Timer > (fps_timer + 1) Then
fps_timer = Timer
fps = fps_counter
fps_counter = 0
EndIf
End Sub
'#################################################
'#################################################
Sub s3d_calc_3d(point3d As Vector3D, point3d_calc As pixel)
point3d.x -= eye.x
point3d.y -= eye.y
point3d.z -= eye.z
point3d_calc.x = (point3d.x / point3d.z) * screen_width + screen_width / 2
point3d_calc.y = (point3d.y / point3d.z) * screen_height + screen_height / 2
'Circle draw_screen ,(point3d_calc.x, point3d_calc.y),3,RGB(255,0,0),,,,f
End Sub
Sub s3d_scale(point3d As Vector3D, x As Single, y As Single, z As single)
point3d.x *= x
point3d.y *= y
point3d.z *= z
End Sub
Sub s3d_move(point3d As Vector3D, x As Single, y As Single, z As Single)
point3d.x += x
point3d.y += y
point3d.z += z
End Sub
Sub rotate_x (obj As Vector3D, beta As Single)
Dim p As Vector3D
p.y = (obj.y * cos(DEGtoRAD * beta) - obj.z * Sin(DEGtoRAD * beta))
p.z = (obj.y * sin(DEGtoRAD * beta) + obj.z * Cos(DEGtoRAD * beta))
obj.y = p.y
obj.z = p.z
End Sub
Sub rotate_y (obj As Vector3D, gamma As Single)
Dim p As Vector3D
p.x = (obj.z * sin(DEGtoRAD * gamma) + obj.x * cos(DEGtoRAD * gamma))
p.z = (obj.z * cos(DEGtoRAD * gamma) - obj.x * Sin(DEGtoRAD * gamma))
obj.x = p.x
obj.z = p.z
End Sub
Sub rotate_z (obj As Vector3D, _Alpha As Single)
Dim p As Vector3D
p.x = (obj.x * cos(DEGtoRAD * _Alpha) + obj.y * Sin(DEGtoRAD * _Alpha))
p.y = (obj.x * sin(DEGtoRAD * _Alpha) - obj.y * Cos(DEGtoRAD * _Alpha))
obj.x = p.x
obj.y = p.y
End Sub
'####################################################




I like the name and the Ideas in your Demo!!!