Menu

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.

Show posts Menu

Messages - CptnRoughnight

#31
It was really the wrong format. The first file that was not playable, has 2304 kbit / s
I did not pay attention. With the second File that only 88kbit / s, it works.

I was afraid it would not work at all.

BTW Audacity is a super sound editing tool! ;)

Thanks for the tip.

=D
#32
Hi,
Next question. Are there any known issues on playing wav files on Pandora?
When I'm programming with Playsound, the Pandora program terminates after start. On Windows it plays the sound!

#33
Thank you!


I'll look at it! The sockets have not tried, but it's apparently a good solution!

I will report on the success or failure! ;)
#34
You mean this thread: http://www.glbasic.com/forum/index.php?topic=5400.0 ?

This one I tried, but the service is not available. How do I call another service in this way, I do not know, I would not actually.

Is there a way with the NET commands, as a server to determine the IP address of the user? That would solve my problem as I had imagined.
#35
Hi folks,

need some help  :)

I have a raspberry pi. This is my server. I need a function that returns me the IP address of the user.
User connects to server and the server sends the IP of the user back to the user. How does it work?

I tried it with NetGetIP $, but that just gives me the IP address on my network (192 172 .....)
:doubt:


#36
Java installieren,  adt installieren, adb treiber fürs tablet installieren und los gehts, meiner Meinung nach!

MfG
#37
Hi,

ich bin nach der Auflistung vorgegangen :
http://de.wikibooks.org/wiki/C-Programmierung:_Ausdr%C3%BCcke_und_Operatoren#Bitweises_exklusives_ODER_.28XOR.29_.5E

Und das ist identisch mit der Erklärung auf XNA.mag :

Quote
zur Erklärung:
"<<" ist der Left-Shift-Operator
"^" ist ein binäres XOR
"&" ist ein binäres AND
"0x7fffffff" ist die Hez-Zahl für 2.147.483.647, also Int32.MaxValue
15731, 789221, 1376312627 sind hohe Primzahlen
1073741824.0f ist (Int32.MaxValue + 1) / 2
Diese Funktion liefert Zahlen von -1 bis 1 zurück, die schön zufällig aussehen Smile

Und die äquivalente Funktion ist doch bXOR, oder täusche ich mich da. Ein exklusives Oder auf Bitebene.
#38
 :-[

Mein Fehler!!!

Ich hab

Code (glbasic) Select

local d


mit

Code (glbasic) Select

local d%


gleichgesetzt, folgender Code funktioniert nun!

Code (glbasic) Select

FUNCTION Noise#:n%
LOCAL d%
d = bXOR(ASL(n,13),n)

RETURN (1.0 - (bAND((d * (d * d * 15731 + 789221) + 1376312627),2147483647)) / 1073741824.0)
ENDFUNCTION



wobei der Schritt mit d nicht sein muss.

Sry für Mehrfachpost... Nun kanns losgehen!
#39
So,

ich habe jetzt das äquivalente Program in C umgesetzt :

Code (glbasic) Select

#include <math.h>
#include <stdio.h>

float noise(int x)
{
x=(x<<13)^x;

return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
}

int main(void)

{
int i;

for(i=0;i<=10;i++)
printf("X(%i)\t = %f \n",i,noise(i));

getchar();
return 0;
}


Ausgabe :
Code (glbasic) Select

X(0)     = -0.281791
X(1)     = -0.226373
X(2)     = 0.293633
X(3)     = -0.257185
X(4)     = 0.585761
X(5)     = -0.712941
X(6)     = 0.311297
X(7)     = 0.123063
X(8)     = -0.813056
X(9)     = -0.032470
X(10)    = 0.929408


Meine GLBasic Ausgabe sieht folgendermaßen aus:

Code (glbasic) Select

X(0)     = -0.2817910193
X(1)     = 1
X(2)     = 1
X(3)     = 1
X(4)     = 1
X(5)     = 1
X(6)     = 1
X(7)     = 1
X(8)     = 1
X(9)     = 1
X(10)   = 1


Ich müsste jetzt raten woran das liegt, der erste Wert wird ja richtig berechnet. Kann es evtl. sein das die bAnd Befehle keine floats bearbeiten und daher der Fehler kommt. Oder hab ich die falschen Befehle verwendet? Aus meiner Sicht müssten es zwei identische Programme sein. Ich komm echt nicht weiter...
#40
Danke für den Hinweis, daran lag es aber nicht. :)

Simplex hab ich mir angeschaut und bleibt im Hinterkopf.

Mir gehts vorallem darum den Algo in GLBasic umzusetzen, den Lerneffekt dabei.
#41
GLBasic - de / Perlin Noise
2013-Sep-11
Hi,
ich beschäftige mich für mein OpenPandora Spiel mit Perlin Noise, möchte den Algo verwenden um die Landschaft zu generieren.
Allerding hapert es an der Umsetzung der Berechnung. Schon der 1D-Noise Algo funzt nicht.

Code (glbasic) Select

x = (x<<13) ^ x;
    return ( 1.0 - ( (x * (x * x * 15731 + 789221) + 1376312589) & 7fffffff) / 1073741824.0);


Diesen Code hab ich versucht mittels GLBasic Befehle umzusetzen.

Code (glbasic) Select

FUNCTION Noise#:n%
LOCAL d#
d = bXOR(ASL(n,13),n)

RETURN (1.0 - bAND((d * (d * d * 15731 + 789221) + 1376312627),2147483647) / 1073741824.0)
ENDFUNCTION


Wenn ich mir mittels der Funktion ein Array fülle und die resultierende Linie (Noise gibt Y-Abweichung an) zeichnen lasse,
dann bekomm ich nur im 1. Arrayfeld eine Abweichung, ansonsten sind es die gleichen Werte.
Hab ich die falschen Befehle genommen?

Das Füllen des Array&Zeichnen :

Code (glbasic) Select

FOR x= 0 TO 100
map[x] = INTEGER(Noise(x))*10
DRAWRECT x*10,100+map[x],10,10,RGB(0,0,255)
NEXT


p.s. das ist alles noch quick&dirty um den Algo zu testen. :)

Ich hoffe auf Hilfe!
#42
That's great! works nicely on my Pandora!
#43
Ok, habs mir angeschaut...  Hatte wohl einen Dreher im Kopf... ist jetzt also klar! Danke
#44
Hi, ja das ist mir Bewusst, wie gesagt ists kein Problem.

Ich bin allerdings gewöhnt das diese Art Abfrage den Wertebereich (1, 0) hat,  also rein auf Gleichheit testen..

#45
Hi, habe folgendes letztens festgestellt.

Wenn ich mittels BAnd abfrage ob ein Bit in einer Variable gesetzt ist (z.b. <dez> 4 - bit 2) dann kommt, wenn wahr nicht 1 sondern 4 als Ergebnis.

Ist das aber nicht falsch, meiner Meinung nach sollte die Funktion nur 0 und 1 zurueckgeben dürfen.

Ist kein Problem, nur verwirrend!

Gesendet von meinem GT-I9305 mit Tapatalk 2