Author Topic: GOOD OLD DAYS - TRO  (Read 4419 times)

0 Members and 1 Guest are viewing this topic.

Offline C3lt1c

  • C= 64
  • **
  • Posts: 77
  • Karma: 26
    • View Profile
GOOD OLD DAYS - TRO
« on: March 29, 2013 »
Hi mates,
I could find some time for coding a new Oldschool Tro for you.
I hope you like it.

The Gfx is pixel by pixel with GDI (no GL) by my own lib.

It was back an quick and dirty action.

Cheers C3lt1c


« Last Edit: March 29, 2013 by C3lt1c »
OLD SCHOOL ROCKZZZ

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1217
  • Karma: 230
    • View Profile
    • Homepage
Re: GOOD OLD DAYS - TRO
« Reply #1 on: March 29, 2013 »
Wonderfull, excellent tune, awesome cracktro!  :clap:
www.kirl.nl
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: GOOD OLD DAYS - TRO
« Reply #2 on: March 29, 2013 »
I love the Music and also Vertical Rotate Fonts is so cool  O0

Well Done  :clap:

Online Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: GOOD OLD DAYS - TRO
« Reply #3 on: March 30, 2013 »
Nice effect, reminds me very much of the cracktro.. Think it was Razor1911 who released it originally? :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: GOOD OLD DAYS - TRO
« Reply #4 on: March 31, 2013 »
hi there excellent stuff!!

could you give me a little walk through of how the text is achieved if at all possible.. i don't need code just a little explanation.. it would be much appreciated, ill pay you two karma's for it  :)  :cheers:
Challenge Trophies Won:

Offline C3lt1c

  • C= 64
  • **
  • Posts: 77
  • Karma: 26
    • View Profile
Re: GOOD OLD DAYS - TRO
« Reply #5 on: April 01, 2013 »
Hi mate,
This is not so hard to code the 3D Dot Textscroller.

1. First you must code a little S3D Engine.
    For help show this link http://aapproj.phatcode.net/qbcodetut/3Dtuts_Relsoft/index.html

2. Now you must code a routine that position the dots as a textfield.
   Either you make for every char a byte array and code a writer    engine. Or you coded it in my way :)

3. I have created a horizontally img_buffer and write a horizontally  white text in terminal font in it. The next part is to read the image buffer pixel by pixel and if the white pixels are detected,  you save the position as your 3D Dot.

4. Rotate all Dots and move them high.

Here is the Code in Freebasic this in not the Pixel by Pixel version (Quick and Dirty code) but i hope it helps you:

Code: [Select]
'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

'####################################################


Cheers C3lt1c  :cheers:
« Last Edit: April 01, 2013 by C3lt1c »
OLD SCHOOL ROCKZZZ

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: GOOD OLD DAYS - TRO
« Reply #6 on: April 01, 2013 »
excellent c3lt1c k++,

such easy to understand intuitive code also!!

so just a quick run down, your code sets up x,y,z info for every cell in the kugel (or vector bob) buffer then analyzes the text buffer, if it finds a light pixel it sets a cell to 1 for rendering and if not 0 to be alphad out in the kugel array then the point gets translated rotated and projected as a vector bob...

im a happy man as this is roughly what my thinking was so i wasnt a million miles away.. this should add an extra dimension too my font engine thanks very much mate.  :cheers:
Challenge Trophies Won: