[R-SIG-Mac] R 2.3.0 and rgl on OS X 10.4.6
Hans-Joerg Bibiko
bibiko at eva.mpg.de
Tue May 23 18:12:15 CEST 2006
Dear all,
I found this thread about R 2.3.0 and rgl on OS X 10.4.6 in the
internet.
I had the same problem. I fixed the source code for api.cpp in that way:
I only changed both lines with -> void rgl_win... ( ... , int* view)
into void rgl_win... ( ... , GLint* view)
line ca. 597 rgl version 0.66
...
void rgl_user2window(int* successptr, int* idata, double* point,
double* pixel, double* model, double* proj, GLint* view)
{
int success = RGL_FAIL;
GLdouble* vertex = pixel;
int columns = idata[0];
Device* device = deviceManager->getAnyDevice();
if ( device ) {
for (int i=0; i<columns; i++) {
gluProject(point[0],point[1],point[2],model,proj,view,
vertex,vertex+1,vertex+2);
vertex[0] /= view[2];
vertex[1] /= view[3];
point += 3;
vertex += 3;
}
success = RGL_SUCCESS;
}
*successptr = success;
}
void rgl_window2user(int* successptr, int* idata, double* point,
double* pixel, double* model, double* proj, GLint* view)
{
int success = RGL_FAIL;
GLdouble* vertex = point;
int columns = idata[0];
Device* device = deviceManager->getAnyDevice();
if ( device ) {
for (int i=0; i<columns; i++) {
pixel[0] *= view[2];
pixel[1] *= view[3];
gluUnProject(pixel[0],pixel[1],pixel[2],model,proj,view,
vertex,vertex+1,vertex+2);
pixel += 3;
vertex += 3;
}
success = RGL_SUCCESS;
}
*successptr = success;
}
...
Then I recompiled this and everything works fine.
It is the first time I post something here and I don't know whether
it is the right place but ...
All the best
Hans-Joerg Bibiko
More information about the R-SIG-Mac
mailing list