On 3/30/11, Mathieu Bouchard <[email protected]> wrote: > I have no use for that. The code I write nowadays does not work on > anything else than the GNU compilers. I also had good knowledge of 16-bit > DOS stuff back then, but chose to try to forget it. > > The only thing I want to do relative to MS compilers, is know how to call > GEM functions from GridFlow, where GEM is compiled by VC++, and GridFlow > is compiled by MinGW. This is (probably) required to get [#from_pix], > [#to_pix] and [gemdead] to work again on Windows.
Here is the MingW docs for how to do that but the link to reimp appears to be dead. http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs If you could reverse engineer this it might work. Appears the stack is reversed and the segments are in diferent chunks. http://www.mmowned.com/forums/world-of-warcraft/bots-programs/memory-editing/281008-gcc-thiscall-calling-convention-linux-win32-mingw.html Indeed the GEM exports are declared like this # define GEM_EXPORT __declspec(dllexport) The thing to do is use vc++ to compile to assembly language an export function. Then get gcc to compile the corresponding import function. Look at the differences and make some inline assembly code to compensate. Here is a reference from the gcc vcc+ veiwpoint. http://wyw.dcweb.cn/stdcall.htm > I am unsufficiently sophisticated for that kind of technology. Instead, I > settled for using Linux. Ha Ha likewise on the unsufficiently. > > What do you mean by « not correct » ? > >> newx = ((x * x) - (y * y) - (z *z)) +k; > > for newx=0, x²-y²-z² = -k, hyberboloïd equation (revolution of hyperbola > around x axis) > >> newy = ((y *x) + (x *y)) +l; > > y*x = x*y, so for newy=0, 2*x*y = -l, another hyperbola formula > (diagonally), but this one has translation symmetry instead, along z axis > (because z is not used in this formula) > >> newz = ((z * x) + (x * z)) +m; > > similar thing. but those * above are not products of floats, tell me right > away. Hopefully the compiler understood. I have also used the quaternion with W removed. Here are my notes on the matter. **********************START OF HISTORY 1996 Formula: newx=((x*x)-(y*y)-(z*z))+k; newy=((x*y)+(x*y))+l; newz=(x*z)+(x*z)+m; >From my green folder that has ENG 111 on the front (guess this explains my bad grammar) A*B=C where A:[x1,y1,z1] B:[x2,y2,z2] C:[x,y,z] [x1,y1,z1] * [x2,y2,z2] = [x,y,z] x = (x1*x2) - (y1*y2) - (z1*z2) y = (x1*y2) + (y1*x2) z = (x1*z2) + (z1*x2) Correct only if A and B are the same Or if x1,y1,z1 are the same and x2,y2,z2 are the same and a few other cases otherwize magnitude of x,y,z is slightly different than A * B ********************************************END OF HISTORY START OF CODE SNIPET********************************************************************* void mandelbrot::iterate(void) { int vtxi; long int p,q,r; int n; double k,l,x,y,z,newx,newy,newz; double m; vtxi=0; for(r=1; r<depth; r++) { for (p=1; p<width; p++) { for (q=1; q<height; q++) { if(julia==0){ k=(double)x1+(x2-x1)*p /(width); l=(double)y1+(y2-y1)*q /(height); m=(double)z1+(z2-z1)*r /(depth); x=realp; y=imagp; z=kapap; }else{ x=(double)x1+(x2-x1)*p /(width); y=(double)y1+(y2-y1)*q /(height); z=(double)z1+(z2-z1)*r /(depth); k=realp; l=imagp; m=kapap; } for (n=1; n<numits; n++) { //newx=x*x-y*y+k; //newy=2*x*y+l; //6-9-2002 equation newx=((y*z)+(z*y))+k; newy=((x*z)+(z*x))+l; newz=((x*y)+(y*x))+m; /* * 2000 equation */ /* * newx=((x*x)-(y*y)-(z*z))+k; * newy=((y*x)-(z*y)+(x*z))+l; * newz=((z*x)+(x*y)-(y*z))+m; */ /* * 1996 equation - see history */ /* * newx=((x*x)-(y*y)-(z*z))+k; * newy=((x*y)+(x*y))+l; * newz=(x*z)+(x*z)+m; */ x=newx; y=newy; z=newz; //putpixel(surface, p+startx-1,q+starty-1,n); //putpixel(surface,(int)(x*10+160),(int)(y*10+100),(unsigned char)n); if (x*x+y*y+z*z>magnitude) { if((n>lowcolor)&&(n<highcolor)) { vtx[vtxi].x=(p/scaledivisor); vtx[vtxi].y=(q/scaledivisor); vtx[vtxi].z=(r/scaledivisor); vtx[vtxi].r=cMap[n].r; vtx[vtxi].g=cMap[n].g; vtx[vtxi].b=cMap[n].b; if(alphamode==0) { vtx[vtxi].a=16; }else{ vtx[vtxi].a=(unsigned char)((0.9375*n)+16);//((256/(256-16)) * n)+16 } vtx[vtxi].n=n; vtxi++; } // putpixel(surface, p+startx-1,q+starty-1,n); //SDL_UpdateRect(screen, p+startx-1, q+starty-1, 1, 1); n=numits; }//mag check }//n }//q }//p }//r nvertexes=vtxi; } *******************************************************************END OF CODE SNIPPET > > Complex numbers have 2 dimensions. The logic that originally led to > finding them doesn't work for more dimensions. Looking at complex numbers > in different ways (as modified vectors or as modified polynomials) leads > to other structures that are interesting, in 2 or 4 or more dimensions, > but fail to be as nice as complex numbers are. Complex numbers are very, > very similar to real numbers. > I don't know of any 3-dimensional number system that is sufficiently > similar to complex numbers to be comparable. > >> a: [x1,y1,z1] >> b: [x2,y2,z2] >> a*b=(y1 * z2 - z1 * y2)i + (x1 * z2 - z1 * x2)j + (x1 * y2 - y1 * x2)k > > this is almost like cross-product, but the j part has the wrong sign. > anyway. cross product is weird because a*a = 0, and this is also the case > for your cross-product-like operator. I have visited this perplexing search for the 3 dimensional equivalent of j or i sporadically. Elusive it is. > I get the following error message : > > :-\ Cette vidéo est privée. > Opération impossible > > _______________________________________________________________________ > | Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC Appologies. You should be able to view it now. I had it set to private instead of hidden. http://www.youtube.com/watch?v=xZUTn-rie8w _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
