On 3/30/11, Mathieu Bouchard matju@artengine.ca wrote:
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...
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.
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
I have visited this perplexing search for the 3 dimensional equivalent of j or i sporadically. Elusive it is.
Appologies. You should be able to view it now. I had it set to private instead of hidden.
On Thu, 31 Mar 2011, Billy Stiltner wrote:
I think that I've read that already, and that I tried to do that, but it wouldn't handle C++-specific things, such as encoding the argument types into the symbols, encoding class name into symbols, namespaces, exceptions, and such.
I can't even get the symbols to be found, thus it's not worth trying %ecx tricks and stuff.
The thing to do is use vc++ to compile to assembly language an export function. Then get gcc to compile the corresponding import function.
I always expected not to have to install MSVC.
It's much of the same : even though it says «C++» in the title, it doesn't say how to deal with C++-specific name mangling such as :
??4imageStruct@@QAEAAU0@ABU0@@Z
and because they contain «?» and «@», they can't be used directly in C++, and stdcall didn't do the job of mangling them VC++-style, and don't know how to get gridflow/src/Gem.def's aliases to work.
Hopefully the compiler understood.
I hadn't looked at the code, only at what you had pasted in the email.
I have visited this perplexing search for the 3 dimensional equivalent of j or i sporadically. Elusive it is.
I'm pretty sure that there are already proofs that the nicest number systems made using a cartesian product of real numbers, are made with two or four dimensions, and everything else is weird. I mean, if you expect that a*(b*c) = (a*b)*c where a,b,c are three vectors, that's quite a difficult property to satisfy, and if you expect that a*a=0 implies a=0, it's even harder to satisfy, etc.
You could read those pages in detail (I haven't) : http://en.wikipedia.org/wiki/Hypercomplex_number http://en.wikipedia.org/wiki/Algebra_over_a_field
I don't understand any of it, but I can certify that a 5-dimensional cube has 80 faces. It's in the big table in this article :
http://en.wikipedia.org/wiki/Hypercube
... which, incidentally, is a very close variant of Pascal's triangle.
so, where does your video come from ?
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC