Show Posts

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.


Topics - neriakX

Pages: [1]
1
This keeps frustrating me since yesterday evening. Regardless what I'm changing .. I can't get it to work like those effect in the video.
I'm so lost, thought it'd be easy .. but I failed. Well, then again I'm a noob ... :(

I think what's missing is some kind of pixel lifetime (TimeToLive). I've seen OOP examples of it, but again, it's a bit hard to understand and port it to FreeBasic using tinyptc.

Here is the video of the effect I wanna try:  http://www.youtube.com/watch?v=qdpxanCY04M at 5:15 minutes


Code: [Select]

'   Particle FX test
'
'
'-------------------------------------------------------------------------------

option Static
option Explicit

'-------------------------------------------------------------------------------
Const XRES = 800
Const YRES = 600

Const HALFXRES = XRES / 2
Const HALFYRES = YRES / 2

Const MYFPS = 60 'PPS

'-------------------------------------------------------------------------------
#Define Ptc_win
#Include "tinyptc_ext.bi"

'-------------------------------------------------------------------------------     
    ' OPEN THE SCREEN;
'-------------------------------------------------------------------------------
'PTC_ALLOWCLOSE(0)
'PTC_SETDIALOG(1,"Particles"+CHR$(13)+"FULL SCREEN?",0,1)   
if (ptc_open("Particles", XRES, YRES) = 0) then end -1

'-------------------------------------------------------------------------------
    ' VARIABLES DEFINITION
'-------------------------------------------------------------------------------
dim shared ScreenBuffer(XRES*YRES) As UInteger

dim Shared as integer x, y
Dim Shared As Integer LP,w


Dim Shared As Integer Particles
Particles = 5000

DIM SHARED speedx (1 TO Particles) AS DOUBLE
DIM SHARED speedy (1 TO Particles) AS Double
Dim SHARED ptx (1 TO Particles) AS DOUBLE
DIM SHARED pty (1 TO Particles) AS Double

'Timei is TIMER var
Dim Shared Timei As Double

'-------------------------------------------------------------------------------
    ' SUBS DEFINITION
'-------------------------------------------------------------------------------

Declare Sub PutPixels( Buffer() as integer, ByVal x As Integer,_
ByVal y As Integer, ByVal col As Integer)

Declare Sub InitParticles()
Declare Sub Explode()
Declare Sub SyncScr()
Declare Sub MILLISECS()

'-------------------------------------------------------------------------------
  ' MAIN LOOP
'-------------------------------------------------------------------------------
DIM SHARED AS DOUBLE M ,oldtime,newtime
dim shared tst as string
    dim shared ticks,t as integer
    ticks=0
    oldtime=Timer
   
While(GETASYNCKEYSTATE(VK_ESCAPE)<> -32767 and PTC_GETLEFTBUTTON=FALSE)
Timei = Timer()
InitParticles()



Erase ScreenBuffer


Explode()

MILLISECS()

ScreenLock()
Ptc_Update @ScreenBuffer(0)
ScreenUnLock()

   
ticks=ticks+1
'SyncScr()
Wend

ptc_close

end 0


Sub InitParticles()
For LP = 1 To Particles
w = Rnd(0)*359
speedx(LP) = (cos(w) * Rnd((1)*2))
speedy(LP) = (-Sin(w) * Rnd((1)*2))
ptx(LP) = HALFXRES + speedx(LP)
pty(LP) = HALFYRES + speedy(LP)
Next
End Sub
Sub PutPixel( Buffer() as integer, ByVal x As Integer, ByVal y As Integer, ByVal col As Integer)
       
    If X>0 And X<XRES-1 And Y>0 And Y<YRES-1 Then
        Buffer(Y * XRES + X) = col
    End If

End Sub


Sub Explode()
For LP = 1 To Particles
PutPixel(ScreenBuffer(), (ptx(LP) + HALFXRES)  * speedx(LP), (pty(LP) + HALFYRES ) * speedy(LP), RGB(255,255,255))
Next
End Sub

' ---------------------------------------------------------
'  FPS counter taken from Shockwave's code
' --------------------------------------------------------

SUB Millisecs()
    t=timer

if  t-oldtime >=1 then
    newtime = ticks
    ticks=0
    oldtime=timer
    TST = str( (newtime) )
    TST = "FPS "+TST
    print tst
end if
                     
end Sub
Sub SyncScr()
Dim As Double SecondsPerFrame

'How long each frame should take to be rendered
SecondsPerFrame = 1 / MYFPS
Print "FPS"
Do: Sleep 1: Loop While Timer - Timei <= SecondsPerFrame
End Sub

Edit: typos and small code change

2
Projects / dbf logo in "3 Dreams of Black"
« on: November 01, 2011 »
Teehee, yesterday I needed a break from making music and had some fun pixeling stuff in 3 Dreams of Black. check it out :)
I must admit, I'm not so good at gfx hrhr, just wanted to make you guys a little gift.

(you need google chrome or firefox to see it).

Too bad .. my pixeled 3d dbf logo didn't make it in yet, I hope it's not lost. However I've made a screenshot for backup ;)
You can see it in attachments.

Here's another quickie. A monster from the game pacman. It's easy to find in the 3d world (http://www.ro.me/?id=503005). The only negative thing is that the engine placed it inside a rock and therefore the bottom part is covered with sand ;)

PacMonster


cheers,
neriakX

update: hmmm, still no mail response of that site, I wonder if they manually approve stuff :-/
update2: it's online. http://www.ro.me/gallery/?id=507001

3
Projects / Some short Looperz
« on: October 28, 2011 »
hrmm .. I can't get no sleep ;) Anyways .. I found two old chiptunes (XM's) in my archive that I've wanted to share with you. You can use 'em if u like. They're soooooo oldschool :)

4
General chat / Just changed my handle!
« on: October 27, 2011 »
Yup, sorry to confuse you guys. But Ichanged my display name to neriakX, which is my proper scene name from now on. The handle 'dizphunKt' is in use for other projects :)

cheers,
neriakX
 

5
Projects / Romeo Knight - Enigma Gun (Extended Mix)
« on: October 26, 2011 »
Hiya,

since 1993 I've always wanted to remix this crazy Sidmon Tune from an Amiga Cracktro composed by Romeo Knight. I've mailed  Romeo (Eike) to make sure it's really a tune from him, because he didn't mention it on his personal website. He acknowledged and gave me the 'Go' to remake his tune.

So here it is .. I'll guess I'll upload it to amigaremix.com soon. I wished I could upload it on scenemusic.net (nectarine) but it seems you have to be a demo musician, which I'm technically not ... yet. Update: It's online now ;)

I'm curious about your opinions and  I'm also glad because this is my debut to show something off here on the forums  :updance:

So here its is, have fun: Enigma Gun(Extended Mix)

I've also attached the orignial Sidmon tune, so you can also check it out. You can play it with XM-Player.

Here's also a short vide of the original cracktro: http://gamesdbase.com/game/commodore-amiga-demos/eishockey-manager.aspx

Enjoy!

PS: the ID3 tag says the remake is done by neriakX, that's also me .. it's my handle for the scene. I should have registered here with that one, but I was used to dizphunkt , which is my real artist name ... ;)

Edit: soooo many freaking typos ....
 

6
Hi guys,

as I'm trying to learn FreeBasic I thought I'd port some examples of http://lodev.org to FreeBasic.
I already made some progress (having fun with plasmas) but this one is hurting my braincells. -> http://lodev.org/cgtutor/sierpinski.html

The first code example on the website does not work in FreeBasic, it looks completely different, so I went for the 2nd method. The result looks a lot better but it's still not the same. I'm not getting rectangles but some kind of triangles. Can you help me find the culprit please? I suspect Modulo being different to '%' in C.

I guess I have used some code snippets from Shockwave, Clyde and other guys to code this thing. So don't be surprised if you find some code similar to your own. (Everyone has to start somewhere =) ). Thanks for your great selection of source codes on the forums!


Ok, here's my code:

Code: [Select]
'  Sierpinski Fractals (http://lodev.org/cgtutor/sierpinski.html)
'
' ported to FreeBasic
' by dizphunkt in 2011
'-------------------------------------------------------------------------------

Option Static
Option Explicit

'-------------------------------------------------------------------------------
Const XRES = 729
Const YRES = 729

Const FPS = 60 'PPS
'-------------------------------------------------------------------------------
'#DEFINE Ptc_win
#Include "tinyptc_ext.bi"

'-------------------------------------------------------------------------------     
    ' OPEN THE SCREEN;
'-------------------------------------------------------------------------------
PTC_ALLOWCLOSE(0)
PTC_SETDIALOG(1,"Sierpinski Fractals"+CHR$(13)+"FULL SCREEN?",0,1)   
if (ptc_open("Sierpinski Fractals", XRES, YRES) = 0) then end -1

Sleep 10

'--------------------------------------------------------------------------
' Hide Mouse Pointer;
'--------------------------------------------------------------------------
'SETMOUSE 1,1,0

'-------------------------------------------------------------------------------
    ' VARIABLES DEFINITION
'-------------------------------------------------------------------------------
dim shared as integer ScreenBuffer(XRES*YRES)
Dim Shared as integer x, y
Dim Shared As Integer r, g, b

'Timei is TIMER var
Dim Shared As Double Timei ', SecondsPerFrame

'-------------------------------------------------------------------------------
    ' SUBS DEFINITION
'-------------------------------------------------------------------------------

Declare Sub FeedPixels( Buffer() as integer, ByVal x As Integer,_
ByVal y As Integer, ByVal col As Integer)

Declare Sub drawCarpet()
Declare Sub RunIntro()
Declare Sub SyncScr()
Declare Sub ClearScr()

'-------------------------------------------------------------------------------
  ' MAIN LOOP
'-------------------------------------------------------------------------------

While(GETASYNCKEYSTATE(VK_ESCAPE)<> -32767 and PTC_GETLEFTBUTTON=FALSE)
Timei = Timer()

RunIntro()

Ptc_Update @ScreenBuffer(0)
Erase ScreenBuffer

SyncScr()
Wend

'------------------------------------------------------------------------------
'The End
'------------------------------------------------------------------------------

ptc_close

end 0

Sub FeedPixels( Buffer() as integer, ByVal x As Integer, ByVal y As Integer, ByVal col As Integer)   
    If X>0 And X<XRES-1 And Y>0 And Y<YRES-1 Then
        Buffer(X + (Y * XRES)) = col
    End If
End Sub


Sub drawCarpet()
For x = 0 To XRES -1
For y = 0 To YRES -1
If Not ((x/1) Mod 3 = 1 And (y/1) Mod 3 = 1) And _
Not ((x/3) Mod 3 = 1 And (y/3) Mod 3 = 1) And _
Not ((x/9) Mod 3 = 1 And (y/9) Mod 3 = 1) And _
Not ((x/27) Mod 3 = 1 And (y/27) Mod 3 = 1) And _
Not ((x/81) Mod 3 = 1 And (y/81) Mod 3 = 1) And _
Not ((x/243) Mod 3 = 1 And (y/243) Mod 3 = 1) Then
FeedPixels(ScreenBuffer(), x, y, RGB(255, 255, 255))
End If
Next
Next   
End Sub

Sub RunIntro()
drawCarpet()
End Sub

Sub SyncScr()
Dim As Double SecondsPerFrame

'How long each frame should take to be rendered
SecondsPerFrame = 1 / FPS

Do: Sleep 1: Loop While Timer - Timei <= SecondsPerFrame
End Sub

Sub ClearScr()
For bx As Integer = 0 To XRES -1
For by As Integer = 0 To YRES -1
FeedPixels(ScreenBuffer(),bx,by,RGB(255,255,255))
Next
Next
End Sub

Pages: [1]