Author Topic: Glenze Vectors (software rendering)  (Read 8679 times)

0 Members and 2 Guests are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Glenze Vectors (software rendering)
« on: April 07, 2007 »
:)

Some more source code for you.. Unoptimised and messy as hell :P

Code: [Select]
'
'                            Something really simple
'
'                          Glenze Vectors By Shockwave
'
'-------------------------------------------------------------------------------
'   PREPROCESSOR;
'-------------------------------------------------------------------------------

  '  #DEFINE PTC_WIN
    #INCLUDE "TINYPTC.BI"
   
'-------------------------------------------------------------------------------
'   DEFINE ALL VARIABLES + STATIC ARRAYS;
'-------------------------------------------------------------------------------

    OPTION STATIC
    OPTION EXPLICIT
   
'-------------------------------------------------------------------------------   
'   SET CONSTANTS;
'-------------------------------------------------------------------------------

    CONST   XRES    =   640
    CONST   YRES    =   480

    CONST   HALFX   =   320
    CONST   HALFY   =   240
   
   
   
'-------------------------------------------------------------------------------     
'   VARIABLE DEFINITIONS;
'-------------------------------------------------------------------------------     

        DIM SHARED AS UINTEGER BUFFER  ( XRES * YRES )
        DIM SHARED AS UINTEGER BUFFER2 ( XRES * YRES )
        DIM SHARED AS DOUBLE GRADD
'---------------------------------------------------------
'            Define the necessary variables;
'---------------------------------------------------------
    DIM shared N AS DOUBLE
    dim shared vx1 as double
    dim shared vx2 as double
    dim shared vy1 as double
    dim shared vy2 as double


    DIM SHARED SIZE AS DOUBLE
    DIM SHARED POINTS AS INTEGER
    DIM SHARED FACES AS INTEGER

    DIM SHARED VXR as double
    dim shared VYR as double
    dim shared VZR AS double

   
    dim shared transforms as integer
    dim shared transformpointer as integer
    dim shared transtimer as double
    transforms = 4
    transtimer = 0
    transformpointer=15 
    points = (transforms+1) * 14

    size=4   
    faces=24

    Dim SHARED Vx(points) AS DOUBLE
    Dim SHARED Vy(points) AS DOUBLE
    Dim SHARED Vz(points) AS DOUBLE
   
    Dim SHARED Vtx(points) AS INTEGER
    Dim SHARED Vty(points) AS INTEGER
    Dim SHARED Vtz(points) AS INTEGER



    Dim SHARED Vf1(faces) AS DOUBLE
    Dim SHARED Vf2(faces) AS DOUBLE
    Dim SHARED Vf3(faces) AS DOUBLE
    Dim SHARED Vf4(faces) AS DOUBLE
    Dim SHARED Vr(faces) AS DOUBLE
    Dim SHARED Vg(faces) AS DOUBLE
    Dim SHARED Vb(faces) AS DOUBLE


 
   
 
'---------------------------------------------------------
'               Read in the Object's points;
'---------------------------------------------------------
    dim A
    For a=1 To points
    Read Vx(a)
    read Vy(a)
    read Vz(a)
    Next

    For a=1 To faces
    Read Vf1(a)
    Read Vf2(a)
    Read Vf3(a)
    Read Vf4(a)
    Read Vr(a)
    READ Vg(a)
    READ Vb(a)
    Next

'-------------------------------------------------------------------------------     
'   SUB DEFINITIONS;
'-------------------------------------------------------------------------------     

    DECLARE SUB FLAT_TRIANGLE( BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER, BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL X3 AS INTEGER, BYVAL Y3 AS INTEGER , BYVAL TC AS INTEGER)
    DECLARE SUB FLAT_TRIANGLE2( BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER, BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL X3 AS INTEGER, BYVAL Y3 AS INTEGER , BYVAL TC AS INTEGER)   
    DECLARE SUB CONSTRUCT()
    DECLARE SUB ROTATE()       
    DECLARE SUB COPY_GLENZE()
    DECLARE SUB MORPH()
   
'-------------------------------------------------------------------------------     
'    TRY OPENING THE SCREEN;
'-------------------------------------------------------------------------------

        IF( PTC_OPEN( " + POSTMORTEM + ", XRES, YRES ) = 0 ) THEN
        END -1
        END IF   
   
'-------------------------------------------------------------------------------
'    MAIN LOOP;
'-------------------------------------------------------------------------------     
SIZE=22
WHILE(1)


    if timer-transtimer>2.5 then morph()   
    if timer-transtimer>4 then
        transformpointer=transformpointer+14
        if transformpointer>=points then transformpointer=15
        transtimer=timer
    end if
   
        ROTATE()
        CONSTRUCT()
        COPY_GLENZE()
   
        PTC_UPDATE@BUFFER(0)
        ERASE BUFFER2
        ERASE BUFFER
       
WEND

END
   
SUB MORPH()
    dim as integer L,P
    dim cunnia as double
    cunnia = .15
    p=transformpointer
    for L=1 to 14
       
    if Vx(L) > VX(P) then VX(L)=VX(L)-cunnia
    if Vy(L) > Vy(P) then VY(L)=VY(L)-cunnia
    if Vz(L) > Vz(P) then VZ(L)=VZ(L)-cunnia

    if Vx(L) < VX(P) then VX(L)=VX(L)+cunnia
    if Vy(L) < Vy(P) then VY(L)=VY(L)+cunnia
    if Vz(L) < Vz(P) then VZ(L)=VZ(L)+cunnia
    p=p+1
   
    next
   
END SUB

SUB COPY_GLENZE()
    DIM AS INTEGER LLX,LLY ,MMUL
    GRADD=GRADD+.1
   
    FOR LLY=HALFY-180 TO HALFY+180
    MMUL=LLY*XRES
    FOR LLX=HALFX-180 TO HALFX+180
        BUFFER(MMUL+LLX)=BUFFER(MMUL+LLX)+BUFFER2(MMUL+LLX)
    NEXT
    NEXT

END SUB



SUB construct()



    DIM A
    DIM  AS DOUBLE N,RD,GR,BL
'---------------------------------------------------------
'              Draw A Face Of The Object;
'---------------------------------------------------------




    For a=1 To faces

'---------------------------------------------------------
'              Draw A Face Of The Object;
'---------------------------------------------------------


  vx1= Vtx(Vf1(a))-Vtx(Vf2(a))
  vy1= Vty(Vf1(a))-Vty(Vf2(a))
  vx2= Vtx(Vf3(a))-Vtx(Vf2(a))
  vy2= Vty(Vf3(a))-Vty(Vf2(a))
  n=  vx1*vy2-vx2*vy1
 
If n>0 THEN

    n=(n/3000)
                        rd=Vr(a)*n : If rd>50 THEN rd=50
                        gr=Vg(a)*n : If gr>50 THEN gr=50
                        bl=Vb(a)*n : If bl>50 THEN bl=50
                        FLAT_TRIANGLE2(Vtx(Vf1(a)),Vty(Vf1(a)),Vtx(Vf2(a)),Vty(Vf2(a)),Vtx(Vf3(a)),Vty(Vf3(a)),RGB(RD,GR,BL))
                        FLAT_TRIANGLE2(Vtx(Vf1(a)),Vty(Vf1(a)),Vtx(Vf4(a)),Vty(Vf4(a)),Vtx(Vf3(a)),Vty(Vf3(a)),RGB(RD,GR,BL))
    End If
    NEXT


    For a=1 To faces

'---------------------------------------------------------
'              Draw A Face Of The Object;
'---------------------------------------------------------


  vx1= Vtx(Vf1(a))-Vtx(Vf2(a))
  vy1= Vty(Vf1(a))-Vty(Vf2(a))
  vx2= Vtx(Vf3(a))-Vtx(Vf2(a))
  vy2= Vty(Vf3(a))-Vty(Vf2(a))
  n=  vx1*vy2-vx2*vy1
 
If n<0 THEN

    n=-(n/500)
                        rd=Vr(a)*n : If rd>180 THEN rd=200
                        gr=Vg(a)*n : If gr>180 THEN gr=200
                        bl=Vb(a)*n : If bl>180 THEN bl=200
                        FLAT_TRIANGLE(Vtx(Vf1(a)),Vty(Vf1(a)),Vtx(Vf2(a)),Vty(Vf2(a)),Vtx(Vf3(a)),Vty(Vf3(a)),RGB(RD,GR,BL))
                        FLAT_TRIANGLE(Vtx(Vf1(a)),Vty(Vf1(a)),Vtx(Vf4(a)),Vty(Vf4(a)),Vtx(Vf3(a)),Vty(Vf3(a)),RGB(RD,GR,BL))
    End If
    NEXT

END SUB


SUB ROTATE()
DIM A
DIM XCUNT AS DOUBLE
xcunt=0
    DIM VX1 AS DOUBLE
    dim VY1 AS DOUBLE
    dim VZ1 AS DOUBLE
   
    DIM VZZ AS DOUBLE   
    dim vxx as double
    dim vyy as double
   
    DIM VDV AS DOUBLE

'###############################################
'## Rotate And Scale Each Point! Store Result ##
'###############################################
 For a=1 To points

    VX1=Vx(a)+XCUNT
    VY1=Vy(a)
   
    VZ1=Vz(a)
   
'######################
'## X,Y,Z rotations! ##
'######################
  Vxx=Vx1
  Vyy=Vy1*cos(Vxr)+Vz1*sin(Vxr)
  Vzz=Vz1*cos(Vxr)-Vy1*sin(Vxr)
 
  Vy1=Vyy
  Vx1=Vxx*cos(Vyr)-Vzz*sin(Vyr)
  Vz1=Vxx*sin(Vyr)+Vzz*cos(Vyr)
 
  Vzz=Vz1
  Vxx=Vx1*cos(Vzr)-Vy1*sin(Vzr)
  Vyy=Vx1*sin(Vzr)+Vy1*cos(Vzr)
'########################
'## Apply Perspective! ##
'########################
  Vdv=(Vzz/40)+1

  Vxx=(size*(Vxx/Vdv))+HALFX
 
  Vyy=(size*(Vyy/Vdv))+HALFY
 
  Vtx(a)=Int(Vxx)
  Vty(a)=Int(Vyy)
  Vtz(a)=Int(Vzz)

 Next

        Vxr=Vxr+.01
        Vyr=Vyr+.02
        Vzr=Vzr+.025

END SUB

SUB FLAT_TRIANGLE(BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER, BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL X3 AS INTEGER, BYVAL Y3 AS INTEGER , BYVAL TC AS INTEGER)
'-------------------------------------------------------------------------
' FLAT TRIANGLE RENDERER WITH ASSEMBLY LANGUAGE RASTERISING BY SHOCKWAVE ^ DBF ^ S!P 2006.
'-------------------------------------------------------------------------
'-------------------------------------------------------------------------
' WE NEED TO SORT THESE POINTS INTO ORDER FROM TOP TO BOTTOM, AN EXCHANGE SORT IS OK.
' AS WE ONLY HAVE GOT 3 POINTS TO ARRANGE.
'-------------------------------------------------------------------------
DIM AS INTEGER TEMPX,TEMPY,LO,LI
                DIM AS INTEGER PX(3)
                DIM AS INTEGER PY(3)
                DIM TFLAG AS INTEGER
                dim pp as uinteger PTR
                DIM AS INTEGER IL1,IL2,SLICE
                TFLAG=0
        PX(1)= X1
        PX(2)= X2
        PX(3)= X3
       
        PY(1)= Y1
        PY(2)= Y2
        PY(3)= Y3

FOR LO = 1 TO 2
    FOR LI =1 TO 2     
        IF PY(LI+1) <= PY(LI) THEN
        TEMPX = PX(LI) : TEMPY = PY(LI)
        PX(LI) = PX(LI+1)
        PY(LI) = PY(LI+1)
        PX(LI+1) = TEMPX
        PY(LI+1) = TEMPY
        END IF   
    NEXT LI
NEXT LO

'   BOOT OUT INVISIBLE TRIANGLES!

    IF PX(1)<0 AND PX(2)<0  AND PX(3)< 0 THEN TFLAG=1
    IF PX(1)>XRES AND PX(2)>XRES  AND PX(3)>XRES THEN TFLAG=1
    IF PY(1)>YRES AND PY(2)>YRES  AND PY(3)>YRES THEN TFLAG=1
   
        DIM AS DOUBLE XP1,XP2:' SCREEN POSITIONS.
        DIM AS DOUBLE XI1,XI2:' INTERPOLATIONS.
       
'***
'*** REGULAR TRIANGLE (Y1<Y2 Y2<Y3)
'***

IF PY(1)<PY(2) AND PY(2)<PY(3) or (PY(2) = PY(3)) THEN
    TFLAG=1
XP1 = PX(1)
XP2 = PX(1)
XI1 = (PX(1)-PX(2)) / (PY(2) - PY(1))
XI2 = (PX(1)-PX(3)) / (PY(3) - PY(1))

FOR LO = PY(1) TO PY(2)-1
   
IF LO>=0 AND LO<YRES THEN

    IF XP1<=XP2 THEN
        IL1=XP1
        IL2=XP2
    ELSE
        IL1=XP2
        IL2=XP1
    END IF
   
    IF IL2>XRES THEN IL2=XRES
    IF IL1<0 THEN IL1=0

    SLICE = IL2-IL1
    IF SLICE>0 THEN
    PP = @BUFFER(IL1+(LO*XRES))   
    asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
    end asm   
    END IF
   

END IF

XP1=XP1-XI1
XP2=XP2-XI2
NEXT

XI1 = (PX(2)-PX(3)) / (PY(3) - PY(2))
XP1 = PX(2)

FOR LO = PY(2) TO PY(3)
IF LO>=0 AND LO<YRES THEN
    IF XP1<=XP2 THEN
        IL1=XP1
        IL2=XP2
    ELSE
        IL1=XP2
        IL2=XP1
    END IF

    IF IL2>XRES THEN IL2=XRES
    IF IL1<0 THEN IL1=0

    SLICE = IL2-IL1
    IF SLICE>0 THEN
    PP = @BUFFER(IL1+(LO*XRES))   
    asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
    end asm   
    END IF
END IF
XP1=XP1-XI1
XP2=XP2-XI2
NEXT

END IF


'***
'*** FLAT TOPPED TRIANGLE Y1=Y2
'***

IF TFLAG=0 AND PY(1) = PY(2) THEN
   
        TFLAG=1
        XP1 = PX(1)
        XP2 = PX(2)
        XI1 = (PX(1)-PX(3)) / (PY(3) - PY(1))
        XI2 = (PX(2)-PX(3)) / (PY(3) - PY(2))
FOR LO = PY(1) TO PY(3)
 IF LO>=0 AND LO<YRES THEN
    IF XP1<=XP2 THEN
        IL1=XP1
        IL2=XP2
    ELSE
        IL1=XP2
        IL2=XP1
    END IF
   
    IF IL2>XRES THEN IL2=XRES
    IF IL1<0 THEN IL1=0
   
    SLICE = IL2-IL1
    IF SLICE>0 THEN
    PP = @BUFFER(IL1+(LO*XRES))   
    asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
    end asm   
    END IF
END IF
    XP1=XP1-XI1
    XP2=XP2-XI2

NEXT
END IF
END SUB
SUB FLAT_TRIANGLE2(BYVAL X1 AS INTEGER , BYVAL Y1 AS INTEGER, BYVAL X2 AS INTEGER , BYVAL Y2 AS INTEGER , BYVAL X3 AS INTEGER, BYVAL Y3 AS INTEGER , BYVAL TC AS INTEGER)
'-------------------------------------------------------------------------
' FLAT TRIANGLE RENDERER WITH ASSEMBLY LANGUAGE RASTERISING BY SHOCKWAVE ^ DBF ^ S!P 2006.
'-------------------------------------------------------------------------
'-------------------------------------------------------------------------
' WE NEED TO SORT THESE POINTS INTO ORDER FROM TOP TO BOTTOM, AN EXCHANGE SORT IS OK.
' AS WE ONLY HAVE GOT 3 POINTS TO ARRANGE.
'-------------------------------------------------------------------------
DIM AS INTEGER TEMPX,TEMPY,LO,LI
                DIM AS INTEGER PX(3)
                DIM AS INTEGER PY(3)
                DIM TFLAG AS INTEGER
                dim pp as uinteger PTR
                DIM AS INTEGER IL1,IL2,SLICE
                TFLAG=0
        PX(1)= X1
        PX(2)= X2
        PX(3)= X3
       
        PY(1)= Y1
        PY(2)= Y2
        PY(3)= Y3
FOR LO = 1 TO 2
    FOR LI =1 TO 2     
        IF PY(LI+1) <= PY(LI) THEN
        TEMPX = PX(LI) : TEMPY = PY(LI)
        PX(LI) = PX(LI+1)
        PY(LI) = PY(LI+1)
        PX(LI+1) = TEMPX
        PY(LI+1) = TEMPY
        END IF   
    NEXT LI
NEXT LO

        DIM AS DOUBLE XP1,XP2:' SCREEN POSITIONS.
        DIM AS DOUBLE XI1,XI2:' INTERPOLATIONS.
       
'***
'*** REGULAR TRIANGLE (Y1<Y2 Y2<Y3)
'***

IF PY(1)<PY(2) AND PY(2)<PY(3) or (PY(2) = PY(3)) THEN
    TFLAG=1
XP1 = PX(1)
XP2 = PX(1)
XI1 = (PX(1)-PX(2)) / (PY(2) - PY(1))
XI2 = (PX(1)-PX(3)) / (PY(3) - PY(1))

FOR LO = PY(1) TO PY(2)-1
   
IF LO>=0 AND LO<YRES THEN

    IF XP1<=XP2 THEN
        IL1=XP1
        IL2=XP2
    ELSE
        IL1=XP2
        IL2=XP1
    END IF
   
    IF IL2>XRES THEN IL2=XRES
    IF IL1<0 THEN IL1=0

    SLICE = IL2-IL1
    IF SLICE>0 THEN
    PP = @BUFFER2(IL1+(LO*XRES))   
    asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
    end asm   
    END IF
   

END IF

XP1=XP1-XI1
XP2=XP2-XI2
NEXT

XI1 = (PX(2)-PX(3)) / (PY(3) - PY(2))
XP1 = PX(2)

FOR LO = PY(2) TO PY(3)
IF LO>=0 AND LO<YRES THEN
    IF XP1<=XP2 THEN
        IL1=XP1
        IL2=XP2
    ELSE
        IL1=XP2
        IL2=XP1
    END IF

    IF IL2>XRES THEN IL2=XRES
    IF IL1<0 THEN IL1=0

    SLICE = IL2-IL1
    IF SLICE>0 THEN
    PP = @BUFFER2(IL1+(LO*XRES))   
    asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
    end asm   
    END IF
END IF
XP1=XP1-XI1
XP2=XP2-XI2
NEXT

END IF


'***
'*** FLAT TOPPED TRIANGLE Y1=Y2
'***

IF TFLAG=0 AND PY(1) = PY(2) THEN
   
        TFLAG=1
        XP1 = PX(1)
        XP2 = PX(2)
        XI1 = (PX(1)-PX(3)) / (PY(3) - PY(1))
        XI2 = (PX(2)-PX(3)) / (PY(3) - PY(2))
FOR LO = PY(1) TO PY(3)
 IF LO>=0 AND LO<YRES THEN
    IF XP1<=XP2 THEN
        IL1=XP1
        IL2=XP2
    ELSE
        IL1=XP2
        IL2=XP1
    END IF
   
    IF IL2>XRES THEN IL2=XRES
    IF IL1<0 THEN IL1=0
   
    SLICE = IL2-IL1
    IF SLICE>0 THEN
    PP = @BUFFER2(IL1+(LO*XRES))   
    asm
        mov eax,dword ptr[TC]
        mov ecx, [slice]
        mov edi, [PP]
        rep stosd
    end asm   
    END IF
END IF
    XP1=XP1-XI1
    XP2=XP2-XI2

NEXT
END IF
END SUB

   
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'   The Object Description As Data!
'   The Data Below Describes A Cube.
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'Points definition;
'~~~~~~~~~~~~~~~~~~
'Below are the points of the Object defined as x,y,z;

Data 5,-5,-5 , 5,5,-5,-5,5,-5,-5,-5,-5,0,0,-5,5,0,0,0
Data 5,0,-5,0,0,0,-5,0,5,-5,5,5,5,5,-5,5,5,-5,-5,5,0,0,5

Data 5,-5,-5 , 5,5,-5,-5,5,-5,-5,-5,-5,0,0,-8,8,0,0,0
Data 8,0,-8,0,0,0,-8,0,5,-5,5,5,5,5,-5,5,5,-5,-5,5,0,0,8

Data 5,-2,-5, 5,2,-5, -5,2,-5, -5,-2,-5, 0,0,-8, 8,0,0
Data 0,2,0,-8,0,0,0,-2,0,5,-2,5,5,2,5,-5,2,5,-5,-2,5,0,0,8

Data 5,-5,-5 , 5,5,-5,-5,5,-5,-5,-5,-5,0,0,-5,5,0,0,0
Data 5,0,-5,0,0,0,-5,0,5,-5,5,5,5,5,-5,5,5,-5,-5,5,0,0,5

Data 5,-5,-5 , 5,5,-5,-5,5,-5,-5,-5,-5,0,0,-8,8,0,0,0
Data 8,0,-8,0,0,0,-8,0,5,-5,5,5,5,5,-5,5,5,-5,-5,5,0,0,8


'Data 5,-5,-5 , 5,5,-5, -5,5,-5, -5,-5,-5, 0,0,-5,8,0,-5
'Data 0,8,-5,-8,0,-5,0,-8,-5 ,2.5,-2.5,2.5, 2.5,2.5,2.5, -2.5,2.5,2.5, -2.5,-2.5,2.5, 0,0,7


'Connection definition;
'Below are the faces of the Object defined as vertice
'numbers, specified in clockwise order. These are followed
'by r,g,b values For the face And finally cell shaded
'parameter (0)=off (1)=on.

Data 10,9,13,13,5,0,0


Data 14,10,13,13,4,4,4
Data 14,13,12,12,5,0,0
Data 8,12,13,13,4,4,4
Data 4,8,13,13,5,0,0
Data 10,14,11,11,5,0,0
Data 10,11,6,6,4,4,4
Data 4,13,9,9,4,4,4

Data 1,4,9,9,5,0,0

Data 1,9,10,10,4,4,4

Data 6,1,10,10,5,0,0
Data 5,4,1,1,4,4,4
Data 8,4,3,3,4,4,4
Data 3,12,8,8,5,0,0
Data 3,4,5,5,5,0,0
Data 7,12,3,3,4,4,4
Data 14,12,11,11,4,4,4
Data 11,12,7,7,5,0,0
Data 6,11,2,2,5,0,0
Data 11,7,2,2,4,4,4
Data 1,6,2,2,4,4,4
Data 2,5,1,1,5,0,0
Data 2,7,3,3,5,0,0
Data 2,3,5,5,4,4,4
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #1 on: April 07, 2007 »
Thats pretty mice, only thing i could say is that the cube spins to fast  :)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #2 on: April 07, 2007 »
Mmm. runs quite smooth here Paul, did you run it in fullscreen or windowed mate?

If you want to slow it down, change the values in the rotate sub, vxr , vyr , vzr .. Make the numbers smaller.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline CoDeMaN

  • Atari ST
  • ***
  • Posts: 127
  • Karma: 38
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #3 on: April 07, 2007 »
Run and looks nice m8 :)

One problem is i couldnt quit out of it ?
noticed this on a few Freebasic programs.....

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #4 on: April 07, 2007 »
@shockwave It ran smooth here in fullscreen and doing what you said slowed the cube down.

Im also hawing problems closing it, i haveto do alt+f4 or sometimes close it with task manager.
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #5 on: April 07, 2007 »
The problems both of you are having are because you are using the standard version of tinyptc.

If you want to do any software rendering work with tinyptc, you absolutely definately 100% should upgrade your version to use the one made by rbraz.

I made a tutorial here;

http://dbfinteractive.com/index.php?cat=131

The reason why you have to quit with the task manager is because of the while wend loop.

While(1) is always true and my code depends on the tinyptc lib looking for escape to be pressed. Your version of tinyptc does not have a proper refresh either which is why the cube looked too fast.

I really can't reccomend you read that tutorial enough, it's very simple to follow, takes less than 10 minutes  and you'll be able to run everything properly then.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Glenze Vectors (software rendering)
« Reply #6 on: April 08, 2007 »
Exe ... exe ... exe   O0
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #7 on: April 08, 2007 »
I've done that tutorial but to use tinytpc_ext i have to include
#INCLUDE "TINYPTC_EXT.BI"
instead of
#INCLUDE "TINYPTC.BI"
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #8 on: April 08, 2007 »
If you do that tutorial to the letter Paul, tinyptc gets updated too, as well as ptc_ext.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #9 on: April 08, 2007 »
Exe attached. :)
Shockwave ^ Codigos
Challenge Trophies Won:

docgen

  • Guest
Re: Glenze Vectors (software rendering)
« Reply #10 on: April 08, 2007 »

Hi!

Quote
Unoptimised and messy as hell

 but fine work!  :)

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #11 on: April 08, 2007 »
You're being kind Stef, but thanks :) I might do a bit more work on it.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Glenze Vectors (software rendering)
« Reply #12 on: April 08, 2007 »
Awesome. Morphing glenz including twisting copperbar. K++ !!!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #13 on: April 09, 2007 »
:) Thanks for the Karma Benny. I'll see if I can turn this into a finished intro.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline CoDeMaN

  • Atari ST
  • ***
  • Posts: 127
  • Karma: 38
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #14 on: April 09, 2007 »
Uninstalled Freebasic and started again ....
Followed the tutorial by Shockwave and everything is working properly at last :)

Cheers Shockwave :)

Whens the next tutorials due lol , something nice and simple even i can follow please lol


Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Glenze Vectors (software rendering)
« Reply #15 on: April 09, 2007 »
Ok, I'll put the ball in your court mate.
What would you like to code?

I'll make a tutorial for you.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: Glenze Vectors (software rendering)
« Reply #16 on: April 09, 2007 »
nice nice nice!  it'll be investigated within the next days.. :D  karma boost!
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline CoDeMaN

  • Atari ST
  • ***
  • Posts: 127
  • Karma: 38
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #17 on: April 11, 2007 »
Ok, I'll put the ball in your court mate.
What would you like to code?

I'll make a tutorial for you.

Hmm lemme think lol

Starfields (3d + normal) using dots or adding own gfx like bubbles (if ya get me drift)
bouncing copper bars
Text writer routine (letter by letter)

1 thing i have problems with is when doing 1 effect is to clear the screen to start another effect
E.G: Scroller at bottom of page with starfield and logo above... how do i clear the top half without interefering with the scroller.


Just some of the old amiga sytle effects but with explanations of how it works :)
(theres some code of these effects about the place but not with explanations of how they work)

What ever you have time / interest in putting up as a tutorial m8 will be appeciated :)

Thanx :)


Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #18 on: April 11, 2007 »
I think the
Quote
Starfields (3d + normal) using dots or adding own gfx like bubbles (if ya get me drift)
sound interesting:)
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Glenze Vectors (software rendering)
« Reply #19 on: April 11, 2007 »
i have a text writter routine i could post for you codeman :)

the thing about clearing the screen is a bit of a difficult one you really want to be clearing the whole screen every frame and drawing just the parts you wish if you have some bust code im sure we could patch it up and show you where your going wrong ;)
Challenge Trophies Won: