[20 Dec 2010] Sort()

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

[20 Dec 2010] Sort()

Post 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

User avatar
airsoftsoftwair
Posts: 4350
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[23 Dec 2010] Re: Sort()

Post 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...

Severin
Posts: 18
Joined: Wed Oct 25, 2017 8:17 pm

[23 Dec 2010] Re: Sort()

Post 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.

ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

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

Post 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 ;-)

ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

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

Post 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

PEB
Posts: 535
Joined: Sun Feb 21, 2010 1:28 am

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

Post 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!

User avatar
Tuxedo
Posts: 301
Joined: Sun Feb 14, 2010 12:41 pm

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

Post 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 :)
Simone"Tuxedo"Monsignori, Perugia, ITALY.

ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

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

Post 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

User avatar
TheMartian
Posts: 109
Joined: Sun Feb 28, 2010 12:51 pm

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

Post 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

ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

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

Post 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 ;-)

Locked