Page 1 of 2

[20 Dec 2010] Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by ArtBlink
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 20 Dec 2010 13:41:40 +0000 (GMT)

Hello, For my hollywood 3D engine, i must to sort array... but they don't work snif! This is the Code:

Code: Select all

For I=0 To 95
    PT[I]={ZM[I],X[I],Y[I],D[I]}
Next
Sort(PT)
What is the problem? the error is:"Wrong operator for this type!" Can you help me? Respect

[23 Dec 2010] Re: Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 23 Dec 2010 23:19:33 +0100
Hello, For my hollywood 3D engine, i must to sort array... but they don't work snif! This is the Code: What is the problem? the error is:"Wrong operator for this type!"
Are you trying to sort a multidimensional array? That won't work... Sort() works only on monodimensional arrays...

[23 Dec 2010] Re: Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by Severin
Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 23 Dec 2010 23:12:58 +0000

Hello Andreas
Are you trying to sort a multidimensional array? That won't work... Sort() works only on monodimensional arrays...
Try this simple bubble sort:

Code: Select all

for i=0 to 95
    for j=0 to 95
        if PT[i] < PT[j]
            temp=copytable(PT[i])
            PT[i]=copytable(PT[j])
            PT[j]=copytable(temp)    
        EndIf
    Next
Next
No idea if it will work, you might have to swap each table element individually.

[24 Dec 2010] Re : Re: Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by ArtBlink
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 24 Dec 2010 07:43:13 +0000 (GMT)

Hello, I have the solution ;-) I dont sort value, but i sort Index:

Code: Select all

For Local I=0 To 169
    RawSet(ZM,I,(ZE[GP1[I]]+ZE[GP2[I]]+ZE[GP3[I]]))
    Tri[ZM[I]]=TZM=ZM[I],TXE1=XE[GP1[I]],TYE1=YE[GP1[I]],TXE2=XE[GP2[I]],TYE2=YE[GP2[I]],TXE3=XE[GP3[I]],TYE3=YE[GP3[I]]}
Next
Sort(ZM, Function(a,b) Return (a>b )EndFunction)
For Local I=0 To 169
    U[0]=Tri[ZM[I]].TXE1
    U[1]=Tri[ZM[I]].TYE1
    U[2]=Tri[ZM[I]].TXE2
    U[3]=Tri[ZM[I]].TYE2
    U[4]=Tri[ZM[I]].TXE3
    U[5]=Tri[ZM[I]].TYE3
Next
i post code later on hollywood forum ;-)

[24 Dec 2010] Re : Re: Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by ArtBlink
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 24 Dec 2010 15:54:42 +0000 (GMT)

Hello all, You can download my 3D engine to: http://jeannoel..free.fr/Amiga/starship3d4.hws I must optimize this engine, but you can display all .geo 3D objet if you know make small code with hollywood. If you found how optimize this code, give you're solution at all Respect

[24 Dec 2010] Re: Re : Re: Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by PEB
Note: This is an archived post that was originally sent to the Hollywood mailing list on Fri, 24 Dec 2010 09:18:37 -0800 (PST)

Nice 3D engine!

[24 Dec 2010] Re: Re : Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by Tuxedo
Note: This is an archived post that was originally sent to the Hollywood mailing list on 24 Dec 2010 21:07:48 +0200

REALLY NICE :)

Here I get 11/12 fps :)

[25 Dec 2010] Re : Re: Re : Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by ArtBlink
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sat, 25 Dec 2010 16:53:46 +0000 (GMT)

I optimized the engine... Try and i think Fps is goodhttp://jeannoel..free.fr/Amiga/starship3d4.hwsRespect

[28 Dec 2010] Re: Re : Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by TheMartian
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 28 Dec 2010 19:27:16 -0000

Hi

I could not help it but just had a chance to try your demo of a spaceship on a really powerful PC running the Windows version of Hollywood. At a framerate of nearly 200 fps it look absolutely beautifully smooth at any type of movement. Perhaps a taste of the future when they get the X1000 up to full speed using both kernals with a good graphics card etc. and available for sale.

Is there any chance that you might put in comments in english in the code?

regards Jesper

[28 Dec 2010] Re : Re: Re : Sort()

Posted: Sat Jun 13, 2020 5:32 pm
by ArtBlink
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 28 Dec 2010 20:21:52 +0000 (GMT)

hihi, I try to translate it this week... i write raycasting engine in hollywood (wolfenstein 3D), when it is finished, i post source code..... I see one man who make raycast engine, but he don't post it, i post it.... but later ;-)

At this time, i can't go forward and backward but i can rotate the scene... Try demo here: http://jeannoel..free.fr/Amiga/raycast/test6800x0.exehttp://jeannoel..free.fr/Amiga/raycast/testAOS4.0.exehttp://jeannoel..free.fr/Amiga/raycast/testmorphos.exehttp://jeannoel..free.fr/Amiga/raycast/testwarpos.exe I work with who want on www.amiga-ng.org or www.amigaimpact.org Ho! i have another code here: http://jeannoel..free.fr/Amiga/demo1.hws ;-)