plib-users Mailing List for PLIB (Page 2)
Brought to you by:
sjbaker
You can subscribe to this list here.
2000 |
Jan
|
Feb
(24) |
Mar
(54) |
Apr
(29) |
May
(58) |
Jun
(29) |
Jul
(675) |
Aug
(46) |
Sep
(40) |
Oct
(102) |
Nov
(39) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(45) |
Feb
(23) |
Mar
(30) |
Apr
(64) |
May
(28) |
Jun
(61) |
Jul
(55) |
Aug
(35) |
Sep
(24) |
Oct
(23) |
Nov
(21) |
Dec
(67) |
2002 |
Jan
(98) |
Feb
(23) |
Mar
(13) |
Apr
(23) |
May
(43) |
Jun
(45) |
Jul
(54) |
Aug
(5) |
Sep
(56) |
Oct
(17) |
Nov
(53) |
Dec
(26) |
2003 |
Jan
(67) |
Feb
(36) |
Mar
(22) |
Apr
(35) |
May
(26) |
Jun
(35) |
Jul
(10) |
Aug
(49) |
Sep
(17) |
Oct
(3) |
Nov
(30) |
Dec
(10) |
2004 |
Jan
(12) |
Feb
(18) |
Mar
(52) |
Apr
(50) |
May
(22) |
Jun
(13) |
Jul
(16) |
Aug
(23) |
Sep
(21) |
Oct
(29) |
Nov
(6) |
Dec
(26) |
2005 |
Jan
(9) |
Feb
(19) |
Mar
(13) |
Apr
(19) |
May
(12) |
Jun
(8) |
Jul
(6) |
Aug
(10) |
Sep
(22) |
Oct
(3) |
Nov
(6) |
Dec
(17) |
2006 |
Jan
(10) |
Feb
(8) |
Mar
(5) |
Apr
(5) |
May
(6) |
Jun
(8) |
Jul
(8) |
Aug
(13) |
Sep
(2) |
Oct
(1) |
Nov
(9) |
Dec
(6) |
2007 |
Jan
(3) |
Feb
(4) |
Mar
(12) |
Apr
(2) |
May
(6) |
Jun
|
Jul
(22) |
Aug
|
Sep
(9) |
Oct
(13) |
Nov
|
Dec
|
2008 |
Jan
(1) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(15) |
Jun
(28) |
Jul
(8) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(2) |
Apr
(7) |
May
(4) |
Jun
(2) |
Jul
(5) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2011 |
Jan
(7) |
Feb
(2) |
Mar
(1) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(4) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Eric B. <eba...@ce...> - 2011-01-23 13:32:27
|
Hello John, I do have it working. The problem was that I was missing libXmu-devel. Thanks for asking, Eric On Sat, 2011-01-22 at 16:03 -0600, John Fay wrote: > Eric, > > Hello and welcome to the PLIB community. I haven't seen if > somebody else has already answered you. It looks from the error > message that it's actually looking for the OpenGL library files rather > than just the include files. Unfortunately PLIB on *nix is not my > forte so I am probably of limited help. > > Let me know if you're still having problems and I will see what I > can find out. > > - John > > > On 1/10/2011 6:50 PM, Eric Bauer wrote: > > > Hello All, > > > > I am trying to get plib installed as part of the process of getting > > speed dreams installed on Fedora 13. It's not going well to say > > the least. When I run the configure script, I get the following > > error" > > > > configure: error: could not find working GL library > > > > > > My GL header files reside at /usr/include/GL, so I am invoking the > > configure script like this: > > > > ]# ./configure --with-GL=/usr > > > > Why am I getting this error? > > > > Eric > > > > > > > > ------------------------------------------------------------------------------ > > Gaining the trust of online customers is vital for the success of any company > > that requires sensitive data to be transmitted over the Web. Learn how to > > best implement a security strategy that keeps consumers' information secure > > and instills the confidence they need to proceed with transactions. > > http://p.sf.net/sfu/oracle-sfdevnl > > > > _______________________________________________ > > plib-users mailing list > > pli...@li... > > https://lists.sourceforge.net/lists/listinfo/plib-users > > |
From: John F. <joh...@cy...> - 2011-01-22 22:03:35
|
Eric, Hello and welcome to the PLIB community. I haven't seen if somebody else has already answered you. It looks from the error message that it's actually looking for the OpenGL library files rather than just the include files. Unfortunately PLIB on *nix is not my forte so I am probably of limited help. Let me know if you're still having problems and I will see what I can find out. - John On 1/10/2011 6:50 PM, Eric Bauer wrote: > Hello All, > > I am trying to get plib installed as part of the process of getting > speed dreams installed on Fedora 13. It's not going well to say the > least. When I run the configure script, I get the following error" > > configure: error: could not find working GL library > > > My GL header files reside at /usr/include/GL, so I am invoking the > configure script like this: > > ]# ./configure --with-GL=/usr > > Why am I getting this error? > > Eric > > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > > > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |
From: Eric B. <eba...@ce...> - 2011-01-11 00:50:15
|
Hello All, I am trying to get plib installed as part of the process of getting speed dreams installed on Fedora 13. It's not going well to say the least. When I run the configure script, I get the following error" configure: error: could not find working GL library My GL header files reside at /usr/include/GL, so I am invoking the configure script like this: ]# ./configure --with-GL=/usr Why am I getting this error? Eric |
From: Maxime C. <umx...@ho...> - 2010-10-01 21:31:40
|
Wow thx that did the trick !!! Le 1 oct. 2010 à 21:18, Jan Reucker a écrit : > On Fri, 1 Oct 2010 19:06:08 +0200 > Maxime CHAPELET <umx...@ho...> wrote: > > >> g++ -o bin/accelero.exe main.o accelero.o -lwinmm ./lib/libplibul.a ./lib/libpli >> bjs.a > > Hello, > > on Win32 g++ is a bit picky about library order. Libs depending on other libs must > be specified before the libs fulfilling the dependencies. If libFoo depends on libBar, > you should use -lFoo -lBar on the command line. So I guess it should work with > > g++ -o bin/accelero.exe main.o accelero.o ./lib/libplibjs.a ./lib/libplibul.a -lwinmm > > because libplibjs depends on libplibul and libwinmm. > > Kind regards, > Jan R. > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |
From: Jan R. <slo...@gm...> - 2010-10-01 19:19:02
|
On Fri, 1 Oct 2010 19:06:08 +0200 Maxime CHAPELET <umx...@ho...> wrote: > g++ -o bin/accelero.exe main.o accelero.o -lwinmm ./lib/libplibul.a ./lib/libpli > bjs.a Hello, on Win32 g++ is a bit picky about library order. Libs depending on other libs must be specified before the libs fulfilling the dependencies. If libFoo depends on libBar, you should use -lFoo -lBar on the command line. So I guess it should work with g++ -o bin/accelero.exe main.o accelero.o ./lib/libplibjs.a ./lib/libplibul.a -lwinmm because libplibjs depends on libplibul and libwinmm. Kind regards, Jan R. |
From: Maxime C. <umx...@ho...> - 2010-10-01 17:24:02
|
I am actually trying to port to Win a little command line app I did in OSX. That app uses plib's js and ul libraries. It works flawlessly on OSX. I tried to compile it on my Win 7 OS using latest Cygwin. I compiled plib statically and no problem so far using this configure options : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- cd plib-1.8.5 ./configure --prefix="/home/Maxime/Lutrin/Libraries" --disable-shared --disable-fnt --disable-pw --disable-net --disable-pui --disable-sg --disable-sg --disable-psl --disable-sl --disable-ssg --disable-puaux --disable-ssgaux make make install ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- But a problem occurs when I try to use those compiled libs it on my code (that compiled fine and worked fine on osx with static plib) : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Maxime@Maxime-WINMAC ~/Lutrin/Accelero Stage 3$ make g++ -o main.o -c main.cpp -W -Wall -ansi -I./include In file included from main.cpp:25: accelero.h:39:3: warning: no newline at end of file In file included from main.cpp:26: main.h:23:5: warning: no newline at end of file main.cpp: In function `int main(int, char**)': main.cpp:72: warning: passing `double' for converting 1 of `void Sleep(DWORD)' main.cpp: At global scope: main.cpp:33: warning: unused parameter 'argc' main.cpp:33: warning: unused parameter 'argv' main.cpp:86:2: warning: no newline at end of file g++ -o accelero.o -c accelero.cpp -W -Wall -ansi -I./include In file included from accelero.cpp:25: accelero.h:39:3: warning: no newline at end of file accelero.cpp:65:2: warning: no newline at end of file g++ -o bin/accelero.exe main.o accelero.o -lwinmm ./lib/libplibul.a ./lib/libpli bjs.a ./lib/libplibjs.a(jsWindows.o): In function `_ZN10jsJoystick4openEv': /home/Maxime/Lutrin/Libraries/Sources/plib-1.8.5/src/js/jsWindows.cxx:106: undef ined reference to `_joyGetDevCapsA@12' /home/Maxime/Lutrin/Libraries/Sources/plib-1.8.5/src/js/jsWindows.cxx:120: undef ined reference to `ulSetError(ulSeverity, char const*, ...)' ./lib/libplibjs.a(jsWindows.o): In function `_ZN10jsJoystickC2Ei': /home/Maxime/Lutrin/Libraries/Sources/plib-1.8.5/src/js/jsWindows.cxx:166: undef ined reference to `_joyGetNumDevs@0' ./lib/libplibjs.a(jsWindows.o): In function `_ZN10jsJoystickC1Ei': /home/Maxime/Lutrin/Libraries/Sources/plib-1.8.5/src/js/jsWindows.cxx:166: undef ined reference to `_joyGetNumDevs@0' ./lib/libplibjs.a(jsWindows.o): In function `_ZN10jsJoystick7rawReadEPiPf': /home/Maxime/Lutrin/Libraries/Sources/plib-1.8.5/src/js/jsWindows.cxx:192: undef ined reference to `_joyGetPosEx@8' /home/Maxime/Lutrin/Libraries/Sources/plib-1.8.5/src/js/jsWindows.cxx:254: undef ined reference to `ulSetError(ulSeverity, char const*, ...)' collect2: ld returned 1 exit status make: *** [accelero.exe] Error 1 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- And here is my Makefile : ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CXX=g++ CXXFLAGS=-W -Wall LDFLAGS= DEBUG= -O3 EXEC=accelero.exe EXECDIR=bin LIBRARIES = ./lib/libplibul.a ./lib/libplibjs.a INCLUDES = -I./include all:$(EXEC) $(EXEC): main.o accelero.o $(CXX) -o $(EXECDIR)/$@ $^ $(LDFLAGS) $(LIBRARIES) main.o: main.cpp accelero.h $(CXX) -o $@ -c $< $(CXXFLAGS) $(INCLUDES) accelero.o: accelero.cpp accelero.h $(CXX) -o $@ -c $< $(CXXFLAGS) $(INCLUDES) clean: rm -rf *.o ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- So is someone can help me to figure out what I could do wrong here ? Thanx in advance. .maxime |
From: Paolo L. <p.l...@ci...> - 2010-07-28 09:01:23
|
Johannes, sorry for the delay, I answered you at once days ago but my webmail system clearly failed, and I didn't save a copy of that message. Well, basically I wrote you: 1. in place of get_eye_matrices, do simply: sgMat4 mview_mat; glGetFloatv(GL_MODELVIEW_MATRIX, (float *)mview_mat); perhaps is just the same as you did. 2. the meaning of mview_mat is the "camera matrix". If you have already set the SSG camera (by one of the many forms of the setCamera ssgContext's methods) before going picking in your program, you can even simply query the resulting modelview matrix: ssgGetCurrentContext()->getModelviewMatrix( mview_mat ); Hope you will soon be successful with SSG picking. Greetings, Paolo _____ Da: Johannes Strömberg [mailto:joh...@gm...] Inviato: lunedì 26 luglio 2010 16.52 A: Paolo Leoncini Cc: PLIB Users Oggetto: Re: [Plib-users] Selecting ssEntity with mouse Hello Paolo, Thanks a lot for the code. I get it to build and it picks objects from the screen but not the correct ones and not allways so some part of the code is wrong. I implemented your get_eye_matrices as follows: void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 mview_mat ) { GLdouble modelview[16]; glGetDoublev(GL_MODELVIEW_MATRIX, modelview); for (int i = 0; i < 4; i++) { for(int j = 0; j < 4; j++) { mview_mat[i][j] = modelview[i*4+j]; } } } but I am not sure it is correct. /Johannes On Fri, Jul 23, 2010 at 11:06 AM, Paolo Leoncini <p.l...@ci...> wrote: Johannes, here is what I do: float z2, x3, y3, z3; if ( Project2d3d ( x, y, z2, x3, y3, z3 ) ) { sgVec3 pick_pnt = {x3, y3, z3}; ulSetError( UL_DEBUG, "picking point (%f,%f,%f)", x3, y3, z3 ); sgMat4 mview_mat; extern void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 mview_mat ); get_eye_matrices( 0, NULL, mview_mat ); // my way of doing glGetDoublev(GL_MODELVIEW_MATRIX, mview_mat) ssgEntityBinding *ebind = getPickedLeaf( z2, pick_pnt, mview_mat, scene ); } x, y are mouse coord, e.g. those arguments of the mouse button press GLUT callback. Project2d3d maps 2D's x,y to 3D's x3,y3,z3, and is listed below (borrowed from a past post): // Project2d3d is the function which will transform 2d into 3d coordinates: int Project2d3d ( int x2, int y2, float& z2, float& x3, float& y3, float& z3 ) { GLint viewport[4] ; GLdouble modvmatrix[16], projmatrix[16] ; glGetIntegerv ( GL_VIEWPORT, viewport ) ; /* OpenGL y starts at lower left, X/Windows y starts at top left */ GLdouble y2gl = viewport[3] - y2 ; /* Use GL power to find the depth of the projection */ glReadPixels ( x2, y2gl, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z2 ) ; if ( z2 >= 1 ) return 0; /* Some more GL magic. Get the projection and modelview matrices */ glGetDoublev ( GL_MODELVIEW_MATRIX, modvmatrix ) ; glGetDoublev ( GL_PROJECTION_MATRIX, projmatrix ) ; GLdouble dx, dy, dz ; /* convert screen coords to object coords. */ int retcode = gluUnProject ( x2, y2gl, z2, modvmatrix, projmatrix, viewport, &dx, &dy, &dz ) ; x3 = dx ; y3 = dy ; z3 = dz ; return retcode; } getPickedLeaf actually intersects a screen-inward ray with the scene graph content, and return the outmost leaf along the SSG coord system's z-axis. ssgEntityBinding *getPickedLeaf( float zmin, sgVec3 center, sgMat4 inv_cam_mat, ssgBranch *scene ) { sgVec3 test_vec, cam_center, up = {0,0,1}; sgMat4 cam_mat, _OpenGL2ssg; extern sgMat4 _ssgOpenGLAxisSwapMatrix; // defined in ssg.cxx // back to SSG coordinate system sgTransposeNegateMat4( _OpenGL2ssg, _ssgOpenGLAxisSwapMatrix ); sgPostMultMat4( inv_cam_mat, _OpenGL2ssg ); sgTransposeNegateMat4( cam_mat, inv_cam_mat ); // rotate the world so to put the 'center' point at the center of the scene sgCopyVec3( cam_center, cam_mat[3] ); sgMakeLookAtMat4( cam_mat, cam_center, center, up ); sgTransposeNegateMat4( inv_cam_mat, cam_mat ); sgSetVec3( test_vec, 0, 1, 0 ); static ssgLeaf *leaf; // its pointer goes outside ssgHit *results, *hit; int num_hits = ssgLOS ( scene, test_vec, inv_cam_mat, &results ) ; if ( num_hits > 0 ) { ulSetError( UL_DEBUG, "hits %d", num_hits ); float min_dst; bool done = false; leaf = NULL; for ( int i = 0 ; i < num_hits ; i++ ) { ssgHit *h = &results [ i ] ; float dst = - h->plane[3] / h->plane[1]; ulSetError( UL_DEBUG, "\tdst %f, zmin %f, min_dst %f", dst, zmin, min_dst ); if ( dst > 0 && (!done || dst < min_dst) ) { done = true; min_dst = dst; leaf = h->leaf; hit = h; ulSetError( UL_DEBUG, "\t\thit %d, leaf '%s', min_dst %f", hit, leaf->getName(), min_dst ); } } // normally at this point one could return the ssgLeaf * 'leaf', yet I need the path-to-node string so I fill & return a ssgEntityBinding if ( leaf != NULL ) { static ssgEntityBinding ebind; static char path_string[1023], *name; strcpy( path_string, "" ); hit->addPath( leaf ); // doesn't include the hit leaf itself, but we need it for ( int i = 0; i < hit->getNumPathEntries(); i++ ) { strcat( path_string, "/" ); strcat( path_string, (name=hit->getPathEntry(i)->getName()) ? name : "" ); } ebind.entity = (ssgEntity**)&leaf; ebind.nameOrPath = ulStrDup( path_string ); return &ebind; } } return NULL; } I hope the code would get compiled with little effort and finally will work. Greetings, Paolo Leoncini _____ Da: Johannes Strömberg [mailto:joh...@gm...] Inviato: venerdì 23 luglio 2010 10.34 A: pli...@li... Oggetto: [Plib-users] Selecting ssEntity with mouse Hello, I need a way of selecting an object on screen using the mouse. How do I convert mouse input to something that I can use with my scene and how do I find what is under the mouse? /Johannes |
From: <p.l...@ci...> - 2010-07-26 15:30:09
|
Scrive Johannes Strömberg <joh...@gm...>: > Hello Paolo, > > Thanks a lot for the code. > > I get it to build and it picks objects from the screen but not the correct > ones and not allways so some part of the code is wrong. I implemented > your get_eye_matrices as follows: > > void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 mview_mat ) > { > GLdouble modelview[16]; > glGetDoublev(GL_MODELVIEW_MATRIX, modelview); > > for (int i = 0; i < 4; i++) > { > for(int j = 0; j < 4; j++) > { > mview_mat[i][j] = modelview[i*4+j]; > } > } > } > > but I am not sure it is correct. as far as I know sgMat4 and OpenGL matrices are laid out in memory the same way assuming you put translations in sgMat4[3][*], and the forst three rows are the rotation part. So you could try this: sgMat4 mview_mat; glGetFloatv(GL_MODELVIEW_MATRIX, (float *)mview_mat); as far as it compiles, it shoud work. Another way to get it is to call: sgMat4 mview_mat; ssgGetCurrentContext()->getModelviewMatrix( mview_mat ); assuming you have ever set the camera till there (i.e. through a call to ssgGetCurrentContext()->setCamera()). Perhaps your solution is correct too, but I'm lazy to think to row- or colum-major order every time, sorry. Paolo > /Johannes > > On Fri, Jul 23, 2010 at 11:06 AM, Paolo Leoncini <p.l...@ci...> wrote: > > > *Johannes,* > > ** > > *here is what I do:* > > > > > > float z2, x3, y3, z3; > > > > if ( Project2d3d ( x, y, z2, x3, y3, z3 ) ) { > > > > sgVec3 pick_pnt = {x3, y3, z3}; > > > > ulSetError( UL_DEBUG, "picking point (%f,%f,%f)", x3, y3, z3 ); > > > > sgMat4 mview_mat; > > > > extern void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 > > mview_mat ); > > > > get_eye_matrices( 0, NULL, mview_mat ); // my way of doing > > glGetDoublev(GL_MODELVIEW_MATRIX, mview_mat) > > > > ssgEntityBinding *ebind = getPickedLeaf( z2, pick_pnt, mview_mat, > > scene ); > > > > } > > > > > > > > *x, y are mouse coord, e.g. those arguments of the mouse button press GLUT > > callback.* > > > > *Project2d3d maps 2D's x,y to 3D's x3,y3,z3, and is listed below (borrowed > > from a past post):* > > > > > > > > // Project2d3d is the function which will transform 2d into 3d coordinates: > > > > int > > Project2d3d ( int x2, int y2, float& z2, float& x3, float& y3, float& z3 ) > > > > { > > > > GLint viewport[4] ; > > > > GLdouble modvmatrix[16], projmatrix[16] ; > > > > glGetIntegerv ( GL_VIEWPORT, viewport ) ; > > > > /* OpenGL y starts at lower left, X/Windows y starts at top left */ > > > > GLdouble y2gl = viewport[3] - y2 ; > > > > /* Use GL power to find the depth of the projection */ > > > > glReadPixels ( x2, y2gl, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z2 ) ; > > > > if ( z2 >= 1 ) return 0; > > > > /* Some more GL magic. Get the projection and modelview matrices */ > > > > glGetDoublev ( GL_MODELVIEW_MATRIX, modvmatrix ) ; > > > > glGetDoublev ( GL_PROJECTION_MATRIX, projmatrix ) ; > > > > GLdouble dx, dy, dz ; > > > > /* convert screen coords to object coords. */ > > > > int retcode = gluUnProject ( x2, y2gl, z2, modvmatrix, projmatrix, > > viewport, &dx, &dy, &dz ) ; > > > > x3 = dx ; > > > > y3 = dy ; > > > > z3 = dz ; > > > > return retcode; > > > > } > > > > > > > > *getPickedLeaf actually intersects a screen-inward ray with the scene > > graph content, and return the outmost leaf along the SSG coord system's > > z-axis.* > > > > > > > > ssgEntityBinding *getPickedLeaf( float zmin, sgVec3 center, sgMat4 > > inv_cam_mat, ssgBranch *scene ) > > > > { > > > > sgVec3 test_vec, cam_center, up = {0,0,1}; > > > > sgMat4 cam_mat, _OpenGL2ssg; > > > > extern sgMat4 _ssgOpenGLAxisSwapMatrix; // defined in ssg.cxx > > > > // back to SSG coordinate system > > > > sgTransposeNegateMat4( _OpenGL2ssg, _ssgOpenGLAxisSwapMatrix ); > > > > sgPostMultMat4( inv_cam_mat, _OpenGL2ssg ); > > > > sgTransposeNegateMat4( cam_mat, inv_cam_mat ); > > > > // rotate the world so to put the 'center' point at the center of the > > scene > > > > sgCopyVec3( cam_center, cam_mat[3] ); > > > > sgMakeLookAtMat4( cam_mat, cam_center, center, up ); > > > > sgTransposeNegateMat4( inv_cam_mat, cam_mat ); > > > > sgSetVec3( test_vec, 0, 1, 0 ); > > > > static ssgLeaf *leaf; // its pointer goes outside > > > > ssgHit *results, *hit; > > > > int num_hits = ssgLOS ( scene, test_vec, inv_cam_mat, &results ) ; > > > > if ( num_hits > 0 ) { > > > > ulSetError( UL_DEBUG, "hits %d", num_hits ); > > > > float min_dst; bool done = false; leaf = NULL; > > > > for ( int i = 0 ; i < num_hits ; i++ ) { > > > > ssgHit *h = &results [ i ] ; > > > > float dst = - h->plane[3] / h->plane[1]; > > > > ulSetError( UL_DEBUG, "\tdst %f, zmin %f, min_dst %f", dst, > > zmin, min_dst ); > > > > if ( dst > 0 && (!done || dst < min_dst) ) { > > > > done = true; > > > > min_dst = dst; > > > > leaf = h->leaf; > > > > hit = h; > > > > ulSetError( UL_DEBUG, "\t\thit %d, leaf '%s', min_dst %f", > > hit, leaf->getName(), min_dst ); > > > > } > > > > } > > > > // normally at this point one could return the ssgLeaf * 'leaf', > > yet I need the path-to-node string so I fill & return a ssgEntityBinding > > > > if ( leaf != NULL ) { > > > > static ssgEntityBinding ebind; > > > > static char path_string[1023], *name; > > > > strcpy( path_string, "" ); > > > > hit->addPath( leaf ); // doesn't include the hit leaf itself, > > but we need it > > > > for ( int i = 0; i < hit->getNumPathEntries(); i++ ) { > > > > strcat( path_string, "/" ); > > > > strcat( path_string, > > (name=hit->getPathEntry(i)->getName()) ? name : "" ); > > > > } > > > > ebind.entity = (ssgEntity**)&leaf; > > > > ebind.nameOrPath = ulStrDup( path_string ); > > > > return &ebind; > > > > } > > > > } > > > > return NULL; > > > > } > > > > > > > > *I hope the code would get compiled with little effort and finally will > > work.* > > > > *Greetings,* > > > > *Paolo Leoncini* > > > > > > ------------------------------ > > *Da:* Johannes Strömberg [mailto:joh...@gm...] > > *Inviato:* venerdì 23 luglio 2010 10.34 > > *A:* pli...@li... > > *Oggetto:* [Plib-users] Selecting ssEntity with mouse > > > > Hello, > > > > I need a way of selecting an object on screen using the mouse. > > > > How do I convert mouse input to something that I can use with my scene and > > how do I find what is under the mouse? > > > > /Johannes > > > > > |
From: Johannes S. <joh...@gm...> - 2010-07-26 14:52:03
|
Hello Paolo, Thanks a lot for the code. I get it to build and it picks objects from the screen but not the correct ones and not allways so some part of the code is wrong. I implemented your get_eye_matrices as follows: void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 mview_mat ) { GLdouble modelview[16]; glGetDoublev(GL_MODELVIEW_MATRIX, modelview); for (int i = 0; i < 4; i++) { for(int j = 0; j < 4; j++) { mview_mat[i][j] = modelview[i*4+j]; } } } but I am not sure it is correct. /Johannes On Fri, Jul 23, 2010 at 11:06 AM, Paolo Leoncini <p.l...@ci...> wrote: > *Johannes,* > ** > *here is what I do:* > > > float z2, x3, y3, z3; > > if ( Project2d3d ( x, y, z2, x3, y3, z3 ) ) { > > sgVec3 pick_pnt = {x3, y3, z3}; > > ulSetError( UL_DEBUG, "picking point (%f,%f,%f)", x3, y3, z3 ); > > sgMat4 mview_mat; > > extern void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 > mview_mat ); > > get_eye_matrices( 0, NULL, mview_mat ); // my way of doing > glGetDoublev(GL_MODELVIEW_MATRIX, mview_mat) > > ssgEntityBinding *ebind = getPickedLeaf( z2, pick_pnt, mview_mat, > scene ); > > } > > > > *x, y are mouse coord, e.g. those arguments of the mouse button press GLUT > callback.* > > *Project2d3d maps 2D's x,y to 3D's x3,y3,z3, and is listed below (borrowed > from a past post):* > > > > // Project2d3d is the function which will transform 2d into 3d coordinates: > > int > Project2d3d ( int x2, int y2, float& z2, float& x3, float& y3, float& z3 ) > > { > > GLint viewport[4] ; > > GLdouble modvmatrix[16], projmatrix[16] ; > > glGetIntegerv ( GL_VIEWPORT, viewport ) ; > > /* OpenGL y starts at lower left, X/Windows y starts at top left */ > > GLdouble y2gl = viewport[3] - y2 ; > > /* Use GL power to find the depth of the projection */ > > glReadPixels ( x2, y2gl, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z2 ) ; > > if ( z2 >= 1 ) return 0; > > /* Some more GL magic. Get the projection and modelview matrices */ > > glGetDoublev ( GL_MODELVIEW_MATRIX, modvmatrix ) ; > > glGetDoublev ( GL_PROJECTION_MATRIX, projmatrix ) ; > > GLdouble dx, dy, dz ; > > /* convert screen coords to object coords. */ > > int retcode = gluUnProject ( x2, y2gl, z2, modvmatrix, projmatrix, > viewport, &dx, &dy, &dz ) ; > > x3 = dx ; > > y3 = dy ; > > z3 = dz ; > > return retcode; > > } > > > > *getPickedLeaf actually intersects a screen-inward ray with the scene > graph content, and return the outmost leaf along the SSG coord system's > z-axis.* > > > > ssgEntityBinding *getPickedLeaf( float zmin, sgVec3 center, sgMat4 > inv_cam_mat, ssgBranch *scene ) > > { > > sgVec3 test_vec, cam_center, up = {0,0,1}; > > sgMat4 cam_mat, _OpenGL2ssg; > > extern sgMat4 _ssgOpenGLAxisSwapMatrix; // defined in ssg.cxx > > // back to SSG coordinate system > > sgTransposeNegateMat4( _OpenGL2ssg, _ssgOpenGLAxisSwapMatrix ); > > sgPostMultMat4( inv_cam_mat, _OpenGL2ssg ); > > sgTransposeNegateMat4( cam_mat, inv_cam_mat ); > > // rotate the world so to put the 'center' point at the center of the > scene > > sgCopyVec3( cam_center, cam_mat[3] ); > > sgMakeLookAtMat4( cam_mat, cam_center, center, up ); > > sgTransposeNegateMat4( inv_cam_mat, cam_mat ); > > sgSetVec3( test_vec, 0, 1, 0 ); > > static ssgLeaf *leaf; // its pointer goes outside > > ssgHit *results, *hit; > > int num_hits = ssgLOS ( scene, test_vec, inv_cam_mat, &results ) ; > > if ( num_hits > 0 ) { > > ulSetError( UL_DEBUG, "hits %d", num_hits ); > > float min_dst; bool done = false; leaf = NULL; > > for ( int i = 0 ; i < num_hits ; i++ ) { > > ssgHit *h = &results [ i ] ; > > float dst = - h->plane[3] / h->plane[1]; > > ulSetError( UL_DEBUG, "\tdst %f, zmin %f, min_dst %f", dst, > zmin, min_dst ); > > if ( dst > 0 && (!done || dst < min_dst) ) { > > done = true; > > min_dst = dst; > > leaf = h->leaf; > > hit = h; > > ulSetError( UL_DEBUG, "\t\thit %d, leaf '%s', min_dst %f", > hit, leaf->getName(), min_dst ); > > } > > } > > // normally at this point one could return the ssgLeaf * 'leaf', > yet I need the path-to-node string so I fill & return a ssgEntityBinding > > if ( leaf != NULL ) { > > static ssgEntityBinding ebind; > > static char path_string[1023], *name; > > strcpy( path_string, "" ); > > hit->addPath( leaf ); // doesn't include the hit leaf itself, > but we need it > > for ( int i = 0; i < hit->getNumPathEntries(); i++ ) { > > strcat( path_string, "/" ); > > strcat( path_string, > (name=hit->getPathEntry(i)->getName()) ? name : "" ); > > } > > ebind.entity = (ssgEntity**)&leaf; > > ebind.nameOrPath = ulStrDup( path_string ); > > return &ebind; > > } > > } > > return NULL; > > } > > > > *I hope the code would get compiled with little effort and finally will > work.* > > *Greetings,* > > *Paolo Leoncini* > > > ------------------------------ > *Da:* Johannes Strömberg [mailto:joh...@gm...] > *Inviato:* venerdì 23 luglio 2010 10.34 > *A:* pli...@li... > *Oggetto:* [Plib-users] Selecting ssEntity with mouse > > Hello, > > I need a way of selecting an object on screen using the mouse. > > How do I convert mouse input to something that I can use with my scene and > how do I find what is under the mouse? > > /Johannes > > |
From: Paolo L. <p.l...@ci...> - 2010-07-23 10:06:33
|
Johannes, here is what I do: float z2, x3, y3, z3; if ( Project2d3d ( x, y, z2, x3, y3, z3 ) ) { sgVec3 pick_pnt = {x3, y3, z3}; ulSetError( UL_DEBUG, "picking point (%f,%f,%f)", x3, y3, z3 ); sgMat4 mview_mat; extern void get_eye_matrices( int eye, sgMat4 proj_mat, sgMat4 mview_mat ); get_eye_matrices( 0, NULL, mview_mat ); // my way of doing glGetDoublev(GL_MODELVIEW_MATRIX, mview_mat) ssgEntityBinding *ebind = getPickedLeaf( z2, pick_pnt, mview_mat, scene ); } x, y are mouse coord, e.g. those arguments of the mouse button press GLUT callback. Project2d3d maps 2D's x,y to 3D's x3,y3,z3, and is listed below (borrowed from a past post): // Project2d3d is the function which will transform 2d into 3d coordinates: int Project2d3d ( int x2, int y2, float& z2, float& x3, float& y3, float& z3 ) { GLint viewport[4] ; GLdouble modvmatrix[16], projmatrix[16] ; glGetIntegerv ( GL_VIEWPORT, viewport ) ; /* OpenGL y starts at lower left, X/Windows y starts at top left */ GLdouble y2gl = viewport[3] - y2 ; /* Use GL power to find the depth of the projection */ glReadPixels ( x2, y2gl, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z2 ) ; if ( z2 >= 1 ) return 0; /* Some more GL magic. Get the projection and modelview matrices */ glGetDoublev ( GL_MODELVIEW_MATRIX, modvmatrix ) ; glGetDoublev ( GL_PROJECTION_MATRIX, projmatrix ) ; GLdouble dx, dy, dz ; /* convert screen coords to object coords. */ int retcode = gluUnProject ( x2, y2gl, z2, modvmatrix, projmatrix, viewport, &dx, &dy, &dz ) ; x3 = dx ; y3 = dy ; z3 = dz ; return retcode; } getPickedLeaf actually intersects a screen-inward ray with the scene graph content, and return the outmost leaf along the SSG coord system's z-axis. ssgEntityBinding *getPickedLeaf( float zmin, sgVec3 center, sgMat4 inv_cam_mat, ssgBranch *scene ) { sgVec3 test_vec, cam_center, up = {0,0,1}; sgMat4 cam_mat, _OpenGL2ssg; extern sgMat4 _ssgOpenGLAxisSwapMatrix; // defined in ssg.cxx // back to SSG coordinate system sgTransposeNegateMat4( _OpenGL2ssg, _ssgOpenGLAxisSwapMatrix ); sgPostMultMat4( inv_cam_mat, _OpenGL2ssg ); sgTransposeNegateMat4( cam_mat, inv_cam_mat ); // rotate the world so to put the 'center' point at the center of the scene sgCopyVec3( cam_center, cam_mat[3] ); sgMakeLookAtMat4( cam_mat, cam_center, center, up ); sgTransposeNegateMat4( inv_cam_mat, cam_mat ); sgSetVec3( test_vec, 0, 1, 0 ); static ssgLeaf *leaf; // its pointer goes outside ssgHit *results, *hit; int num_hits = ssgLOS ( scene, test_vec, inv_cam_mat, &results ) ; if ( num_hits > 0 ) { ulSetError( UL_DEBUG, "hits %d", num_hits ); float min_dst; bool done = false; leaf = NULL; for ( int i = 0 ; i < num_hits ; i++ ) { ssgHit *h = &results [ i ] ; float dst = - h->plane[3] / h->plane[1]; ulSetError( UL_DEBUG, "\tdst %f, zmin %f, min_dst %f", dst, zmin, min_dst ); if ( dst > 0 && (!done || dst < min_dst) ) { done = true; min_dst = dst; leaf = h->leaf; hit = h; ulSetError( UL_DEBUG, "\t\thit %d, leaf '%s', min_dst %f", hit, leaf->getName(), min_dst ); } } // normally at this point one could return the ssgLeaf * 'leaf', yet I need the path-to-node string so I fill & return a ssgEntityBinding if ( leaf != NULL ) { static ssgEntityBinding ebind; static char path_string[1023], *name; strcpy( path_string, "" ); hit->addPath( leaf ); // doesn't include the hit leaf itself, but we need it for ( int i = 0; i < hit->getNumPathEntries(); i++ ) { strcat( path_string, "/" ); strcat( path_string, (name=hit->getPathEntry(i)->getName()) ? name : "" ); } ebind.entity = (ssgEntity**)&leaf; ebind.nameOrPath = ulStrDup( path_string ); return &ebind; } } return NULL; } I hope the code would get compiled with little effort and finally will work. Greetings, Paolo Leoncini _____ Da: Johannes Strömberg [mailto:joh...@gm...] Inviato: venerdì 23 luglio 2010 10.34 A: pli...@li... Oggetto: [Plib-users] Selecting ssEntity with mouse Hello, I need a way of selecting an object on screen using the mouse. How do I convert mouse input to something that I can use with my scene and how do I find what is under the mouse? /Johannes |
From: Johannes S. <joh...@gm...> - 2010-07-23 08:34:28
|
Hello, I need a way of selecting an object on screen using the mouse. How do I convert mouse input to something that I can use with my scene and how do I find what is under the mouse? /Johannes |
From: Melchior F. <mel...@gm...> - 2010-06-01 12:01:56
|
* John F. Fay -- Tuesday 01 June 2010: > As you can see, I had a bit of trouble with the > Windows e-mail program (Eudora) deciphering the > Linux (I think) message, Oops, sorry about that. Yeah, there are a few bytes here which shouldn't be. That comes from copying the error output over from a terminal window, and I think that's an old KDE bug. Eudora should just skip them though. Oh well. > but I think I got it right. Yes, excellent recovery, thanks. :-) m. |
From: John F. F. <joh...@cy...> - 2010-06-01 11:50:15
|
As you can see, I had a bit of trouble with the Windows e-mail program (Eudora) deciphering the Linux (I think) message, but I think I got it right. I have put what I think is the correct change into SVN. Please test it out. - John At 08:45 AM 5/31/2010, you wrote: >Sending again, because I used the wrong email >address. Twice! Sigh. * John F. Fay -- Monday 31 >May 2010: > It uses the functions "_isnan" and >"_isfinite" which are just > fine on my >Windows/MSVC platform. For some reason MICROS~1 >is in love with these underscore functions, >which are, in the real world, just isnan() and >isfinite(). So this doesn't compile on >Linux: sg.cxx: In function âvoid >sgQuatToAngleAxis(float*, float*, const >float*)â: sg.cxx:1311: error: â_isnanâ >was not declared in this scope sg.cxx:1311: >error: â_finiteâ was not declared in this >scope I suggest to do something like this: diff >--git a/src/sg/sg.cxx b/src/sg/sg.cxx index >0e182fb..b6aa05c 100644 --- a/src/sg/sg.cxx +++ >b/src/sg/sg.cxx @@ -24,6 +24,12 @@ #include >"sg.h" +#ifdef UL_WIN32 +# define isnan _isnan >+# define finite _finite +#endif + + sgVec3 >_sgGravity = { 0.0f, 0.0f, -9.8f } ; void >sgVectorProductVec3 ( sgVec3 dst, const sgVec3 >a, const sgVec3 b ) @@ -1308,7 +1314,7 @@ void >sgQuatToAngleAxis ( SGfloat *angle, void >sgQuatToAngleAxis ( SGfloat *angle, sgVec3 axis, >const sgQuat src ) { SGfloat a = (SGfloat) >acos ( src[SG_W] ) ; - if ( _isnan(a) || >!_finite(a) ) { + if ( isnan(a) || !finite(a) ) >{ ulSetError(UL_WARNING,"sgQuatToAngleAxis: >acos(%f) %f",src[SG_W],a); if ( >src[SG_W] >= 1 ) a = 0; else if ( src[SG_W] ><= -1 ) a = SG_PI; m. >------------------------------------------------------------------------------ >_______________________________________________ >plib-users mailing list >pli...@li... >https://lists.sourceforge.net/lists/listinfo/plib-users |
From: Melchior F. <mel...@gm...> - 2010-05-31 14:12:08
|
Sending again, because I used the wrong email address. Twice! Sigh. * John F. Fay -- Monday 31 May 2010: > It uses the functions "_isnan" and "_isfinite" which are just > fine on my Windows/MSVC platform. For some reason MICROS~1 is in love with these underscore functions, which are, in the real world, just isnan() and isfinite(). So this doesn't compile on Linux: sg.cxx: In function ‘void sgQuatToAngleAxis(float*, float*, const float*)’: sg.cxx:1311: error: ‘_isnan’ was not declared in this scope sg.cxx:1311: error: ‘_finite’ was not declared in this scope I suggest to do something like this: diff --git a/src/sg/sg.cxx b/src/sg/sg.cxx index 0e182fb..b6aa05c 100644 --- a/src/sg/sg.cxx +++ b/src/sg/sg.cxx @@ -24,6 +24,12 @@ #include "sg.h" +#ifdef UL_WIN32 +# define isnan _isnan +# define finite _finite +#endif + + sgVec3 _sgGravity = { 0.0f, 0.0f, -9.8f } ; void sgVectorProductVec3 ( sgVec3 dst, const sgVec3 a, const sgVec3 b ) @@ -1308,7 +1314,7 @@ void sgQuatToAngleAxis ( SGfloat *angle, void sgQuatToAngleAxis ( SGfloat *angle, sgVec3 axis, const sgQuat src ) { SGfloat a = (SGfloat) acos ( src[SG_W] ) ; - if ( _isnan(a) || !_finite(a) ) { + if ( isnan(a) || !finite(a) ) { ulSetError(UL_WARNING,"sgQuatToAngleAxis: acos(%f) %f",src[SG_W],a); if ( src[SG_W] >= 1 ) a = 0; else if ( src[SG_W] <= -1 ) a = SG_PI; m. |
From: John F. F. <joh...@cy...> - 2010-05-31 12:35:54
|
Gentlemen, I have just put the below-mentioned patch into PLIB. It uses the functions "_isnan" and "_isfinite" which are just fine on my Windows/MSVC platform. Please check it out on other platforms and let me know of any problems. - John At 09:40 AM 4/21/2010, you wrote: >John, > >Please find attached the patch. > >This patch also include a fix to the function sgQuatToAxisAngle which >manages cases of Quat's W outside the range [-1:1] (acos undefined). For >this I used _isnan and _finite functions in MS Visual C++, whose >availability I ask all of you to verify on other Plib-supported platforms. >Otherwise just ignore this second part of the patch. > >Thanks a lot, > >Paolo Leoncini > > > > -----Messaggio originale----- > > Da: Fay, John F Dr CTR USAF AFMC 46 SK > > [mailto:joh...@eg...] > > Inviato: sabato 17 aprile 2010 18.33 > > A: PLIB Users > > Oggetto: Re: [Plib-users] R: culling problems w/ off-axis projection > > > > Paolo, > > > > Congratulations and very good on having solved the > > problem. Is there a code change that you want me to put into > > Subversion? > > > > Dr. John F. Fay > > Technical Fellow > > Jacobs Technology TEAS Group > > 850-883-1294 > > > > > > -----Original Message----- > > From: Paolo Leoncini [mailto:p.l...@ci...] > > Sent: Monday, April 12, 2010 3:21 AM > > To: 'PLIB Users' > > Subject: [Plib-users] R: culling problems w/ off-axis projection > > > > Dear friends, > > > > I think to have solved the problem. > > > > > -----Messaggio originale----- > > > Da: p.l...@ci... [mailto:p.l...@ci...] > > > Inviato: martedì 6 aprile 2010 11.19 > > > A: pli...@li... > > > Oggetto: [Plib-users] culling problems w/ off-axis projection > > > > > > Dear all, > > > > > > I'm doing off-axis projection (the most general form of > > > projection) by translating the four corners of the screen into a > > > projection matrix, for which I added a new method to the sgFrustum > > > class and to the Context too. The only difference with > > giving the six > > > frustum extrema values is that no calculation occurs. > > Culling seems to > > > rely only on the projection matrix values, so, apparently, no > > > difference w/ the on-axis standard case. > > > > > > As far as the projection is not far from the on-axis case > > the culling > > > gives no problem. Instead when screen position definition > > results in a > > > large rotation in the projection matrix objects suddenly > > disappear and > > > reappear by apparently no rule. > > > > > > Are culling calculations based on a particular form of the > > projection > > > matrix? > > > should culling planes be extracted in a different way to > > support the > > > more general case? > > > > In sgFrustum::contains( const sgSphere *s ) (sg.cxx), the for > > the non-ortho case which is presently done this way: > > > > sp1 = plane[ SG_LEFT_PLANE ][0] * center[0] + plane[ > > SG_LEFT_PLANE ][2] * center[2] ; > > sp2 = plane[ SG_RIGHT_PLANE ][0] * center[0] + plane[ > > SG_RIGHT_PLANE ][2] * center[2] ; > > sp3 = plane[ SG_BOT_PLANE ][1] * center[1] + plane[ SG_BOT_PLANE > > ][2] * center[2] ; > > sp4 = plane[ SG_TOP_PLANE ][1] * center[1] + plane[ SG_TOP_PLANE > > ][2] * center[2] ; > > > > should be substituted by the following general form: > > > > sp1 = sgScalarProductVec3 ( plane[ SG_LEFT_PLANE ], > > center ) + plane[ SG_LEFT_PLANE ][3] ; > > sp2 = sgScalarProductVec3 ( plane[ SG_RIGHT_PLANE ], > > center ) + plane[ SG_RIGHT_PLANE ][3] ; > > sp3 = sgScalarProductVec3 ( plane[ SG_BOT_PLANE ], > > center ) + plane[ > > SG_BOT_PLANE ][3] ; > > sp4 = sgScalarProductVec3 ( plane[ SG_TOP_PLANE ], > > center ) + plane[ > > SG_TOP_PLANE ][3] ; > > > > The hint were just below there (see comment "Note: in the > > general case, we would have to do:"). > > I propose to patch it since this general form also manages > > the default on-axis case, but Steve should definitely give > > the go-ahead. > > Should someone be concerned about performances I could supply > > a bit larger patch for introducing the ability to supply the > > Context a general perspective matrix, so to have the general > > case only calculated in this eventuality. > > > > > Thanks a lot, > > > > > > Paolo Leoncini > > > > Thanks in advance to a good will updater (John, it's you as usual?). > > > > Paolo Leoncini > > > > > > > -------------------------------------------------------------- > > > ---------------- > > > Download Intel® Parallel Studio Eval Try the new > > software tools > > > for yourself. Speed compiling, find bugs proactively, and fine-tune > > > applications for parallel performance. > > > See why Intel Parallel Studio got high marks during beta. > > > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > > > plib-users mailing list > > > pli...@li... > > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > > > > > > -------------------------------------------------------------- > > ---------------- > > Download Intel® Parallel Studio Eval Try the new > > software tools for yourself. Speed compiling, find bugs > > proactively, and fine-tune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > plib-users mailing list > > pli...@li... > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > -------------------------------------------------------------- > > ---------------- > > Download Intel® Parallel Studio Eval Try the new > > software tools for yourself. Speed compiling, find bugs > > proactively, and fine-tune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > plib-users mailing list > > pli...@li... > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > >------------------------------------------------------------------------------ > >_______________________________________________ >plib-users mailing list >pli...@li... >https://lists.sourceforge.net/lists/listinfo/plib-users |
From: Paolo L. <p.l...@ci...> - 2010-05-31 08:22:59
|
John, > -----Messaggio originale----- > Da: John F. Fay [mailto:joh...@cy...] > Inviato: sabato 29 maggio 2010 4.15 > A: PLIB Users > Oggetto: Re: [Plib-users] R: R: culling problems w/ off-axis > projection > > Paolo, > Message-Id: <201...@yo...> > > Please pardon my delay in answering; May is never a > good month for me. Did this patch get put in already, No. > or did the patch file switch the "from" and "to" versions? Yes. > - John Thanks for taking care of it. Greetings, Paolo > At 09:40 AM 4/21/2010, you wrote: > >John, > > > >Please find attached the patch. > > > >This patch also include a fix to the function > sgQuatToAxisAngle which > >manages cases of Quat's W outside the range [-1:1] (acos undefined). > >For this I used _isnan and _finite functions in MS Visual C++, whose > >availability I ask all of you to verify on other > Plib-supported platforms. > >Otherwise just ignore this second part of the patch. > > > >Thanks a lot, > > > >Paolo Leoncini > > > > > > > -----Messaggio originale----- > > > Da: Fay, John F Dr CTR USAF AFMC 46 SK > > > [mailto:joh...@eg...] > > > Inviato: sabato 17 aprile 2010 18.33 > > > A: PLIB Users > > > Oggetto: Re: [Plib-users] R: culling problems w/ off-axis > projection > > > > > > Paolo, > > > > > > Congratulations and very good on having solved the > problem. > > > Is there a code change that you want me to put into Subversion? > > > > > > Dr. John F. Fay > > > Technical Fellow > > > Jacobs Technology TEAS Group > > > 850-883-1294 > > > > > > > > > -----Original Message----- > > > From: Paolo Leoncini [mailto:p.l...@ci...] > > > Sent: Monday, April 12, 2010 3:21 AM > > > To: 'PLIB Users' > > > Subject: [Plib-users] R: culling problems w/ off-axis projection > > > > > > Dear friends, > > > > > > I think to have solved the problem. > > > > > > > -----Messaggio originale----- > > > > Da: p.l...@ci... [mailto:p.l...@ci...] > > > > Inviato: martedì 6 aprile 2010 11.19 > > > > A: pli...@li... > > > > Oggetto: [Plib-users] culling problems w/ off-axis projection > > > > > > > > Dear all, > > > > > > > > I'm doing off-axis projection (the most general form of > > > > projection) by translating the four corners of the > screen into a > > > > projection matrix, for which I added a new method to > the sgFrustum > > > > class and to the Context too. The only difference with > > > giving the six > > > > frustum extrema values is that no calculation occurs. > > > Culling seems to > > > > rely only on the projection matrix values, so, apparently, no > > > > difference w/ the on-axis standard case. > > > > > > > > As far as the projection is not far from the on-axis case > > > the culling > > > > gives no problem. Instead when screen position definition > > > results in a > > > > large rotation in the projection matrix objects suddenly > > > disappear and > > > > reappear by apparently no rule. > > > > > > > > Are culling calculations based on a particular form of the > > > projection > > > > matrix? > > > > should culling planes be extracted in a different way to > > > support the > > > > more general case? > > > > > > In sgFrustum::contains( const sgSphere *s ) (sg.cxx), the for the > > > non-ortho case which is presently done this way: > > > > > > sp1 = plane[ SG_LEFT_PLANE ][0] * center[0] + plane[ > > > SG_LEFT_PLANE ][2] * center[2] ; > > > sp2 = plane[ SG_RIGHT_PLANE ][0] * center[0] + plane[ > > > SG_RIGHT_PLANE ][2] * center[2] ; > > > sp3 = plane[ SG_BOT_PLANE ][1] * center[1] + plane[ > SG_BOT_PLANE > > > ][2] * center[2] ; > > > sp4 = plane[ SG_TOP_PLANE ][1] * center[1] + plane[ > SG_TOP_PLANE > > > ][2] * center[2] ; > > > > > > should be substituted by the following general form: > > > > > > sp1 = sgScalarProductVec3 ( plane[ SG_LEFT_PLANE ], > center ) + > > > plane[ SG_LEFT_PLANE ][3] ; > > > sp2 = sgScalarProductVec3 ( plane[ SG_RIGHT_PLANE ], > center ) + > > > plane[ SG_RIGHT_PLANE ][3] ; > > > sp3 = sgScalarProductVec3 ( plane[ SG_BOT_PLANE ], > > > center ) + plane[ > > > SG_BOT_PLANE ][3] ; > > > sp4 = sgScalarProductVec3 ( plane[ SG_TOP_PLANE ], > > > center ) + plane[ > > > SG_TOP_PLANE ][3] ; > > > > > > The hint were just below there (see comment "Note: in the general > > > case, we would have to do:"). > > > I propose to patch it since this general form also manages the > > > default on-axis case, but Steve should definitely give > the go-ahead. > > > Should someone be concerned about performances I could > supply a bit > > > larger patch for introducing the ability to supply the Context a > > > general perspective matrix, so to have the general case only > > > calculated in this eventuality. > > > > > > > Thanks a lot, > > > > > > > > Paolo Leoncini > > > > > > Thanks in advance to a good will updater (John, it's you > as usual?). > > > > > > Paolo Leoncini > > > > > > > > > > -------------------------------------------------------------- > > > > ---------------- > > > > Download Intel® Parallel Studio Eval Try the new > > > software tools > > > > for yourself. Speed compiling, find bugs proactively, and > > > > fine-tune applications for parallel performance. > > > > See why Intel Parallel Studio got high marks during beta. > > > > http://p.sf.net/sfu/intel-sw-dev > > > > _______________________________________________ > > > > plib-users mailing list > > > > pli...@li... > > > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > > > > > > > > > > -------------------------------------------------------------- > > > ---------------- > > > Download Intel® Parallel Studio Eval Try the new > software tools > > > for yourself. Speed compiling, find bugs proactively, and > fine-tune > > > applications for parallel performance. > > > See why Intel Parallel Studio got high marks during beta. > > > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > > > plib-users mailing list > > > pli...@li... > > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > > > -------------------------------------------------------------- > > > ---------------- > > > Download Intel® Parallel Studio Eval Try the new > software tools > > > for yourself. Speed compiling, find bugs proactively, and > fine-tune > > > applications for parallel performance. > > > See why Intel Parallel Studio got high marks during beta. > > > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > > > plib-users mailing list > > > pli...@li... > > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > > > > > >------------------------------------------------------------- > ---------- > >------- > > > >_______________________________________________ > >plib-users mailing list > >pli...@li... > >https://lists.sourceforge.net/lists/listinfo/plib-users > > > -------------------------------------------------------------- > ---------------- > > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |
From: John F. F. <joh...@cy...> - 2010-05-29 02:28:28
|
Paolo, Message-Id: <201...@yo...> Please pardon my delay in answering; May is never a good month for me. Did this patch get put in already, or did the patch file switch the "from" and "to" versions? - John At 09:40 AM 4/21/2010, you wrote: >John, > >Please find attached the patch. > >This patch also include a fix to the function sgQuatToAxisAngle which >manages cases of Quat's W outside the range [-1:1] (acos undefined). For >this I used _isnan and _finite functions in MS Visual C++, whose >availability I ask all of you to verify on other Plib-supported platforms. >Otherwise just ignore this second part of the patch. > >Thanks a lot, > >Paolo Leoncini > > > > -----Messaggio originale----- > > Da: Fay, John F Dr CTR USAF AFMC 46 SK > > [mailto:joh...@eg...] > > Inviato: sabato 17 aprile 2010 18.33 > > A: PLIB Users > > Oggetto: Re: [Plib-users] R: culling problems w/ off-axis projection > > > > Paolo, > > > > Congratulations and very good on having solved the > > problem. Is there a code change that you want me to put into > > Subversion? > > > > Dr. John F. Fay > > Technical Fellow > > Jacobs Technology TEAS Group > > 850-883-1294 > > > > > > -----Original Message----- > > From: Paolo Leoncini [mailto:p.l...@ci...] > > Sent: Monday, April 12, 2010 3:21 AM > > To: 'PLIB Users' > > Subject: [Plib-users] R: culling problems w/ off-axis projection > > > > Dear friends, > > > > I think to have solved the problem. > > > > > -----Messaggio originale----- > > > Da: p.l...@ci... [mailto:p.l...@ci...] > > > Inviato: martedì 6 aprile 2010 11.19 > > > A: pli...@li... > > > Oggetto: [Plib-users] culling problems w/ off-axis projection > > > > > > Dear all, > > > > > > I'm doing off-axis projection (the most general form of > > > projection) by translating the four corners of the screen into a > > > projection matrix, for which I added a new method to the sgFrustum > > > class and to the Context too. The only difference with > > giving the six > > > frustum extrema values is that no calculation occurs. > > Culling seems to > > > rely only on the projection matrix values, so, apparently, no > > > difference w/ the on-axis standard case. > > > > > > As far as the projection is not far from the on-axis case > > the culling > > > gives no problem. Instead when screen position definition > > results in a > > > large rotation in the projection matrix objects suddenly > > disappear and > > > reappear by apparently no rule. > > > > > > Are culling calculations based on a particular form of the > > projection > > > matrix? > > > should culling planes be extracted in a different way to > > support the > > > more general case? > > > > In sgFrustum::contains( const sgSphere *s ) (sg.cxx), the for > > the non-ortho case which is presently done this way: > > > > sp1 = plane[ SG_LEFT_PLANE ][0] * center[0] + plane[ > > SG_LEFT_PLANE ][2] * center[2] ; > > sp2 = plane[ SG_RIGHT_PLANE ][0] * center[0] + plane[ > > SG_RIGHT_PLANE ][2] * center[2] ; > > sp3 = plane[ SG_BOT_PLANE ][1] * center[1] + plane[ SG_BOT_PLANE > > ][2] * center[2] ; > > sp4 = plane[ SG_TOP_PLANE ][1] * center[1] + plane[ SG_TOP_PLANE > > ][2] * center[2] ; > > > > should be substituted by the following general form: > > > > sp1 = sgScalarProductVec3 ( plane[ SG_LEFT_PLANE ], > > center ) + plane[ SG_LEFT_PLANE ][3] ; > > sp2 = sgScalarProductVec3 ( plane[ SG_RIGHT_PLANE ], > > center ) + plane[ SG_RIGHT_PLANE ][3] ; > > sp3 = sgScalarProductVec3 ( plane[ SG_BOT_PLANE ], > > center ) + plane[ > > SG_BOT_PLANE ][3] ; > > sp4 = sgScalarProductVec3 ( plane[ SG_TOP_PLANE ], > > center ) + plane[ > > SG_TOP_PLANE ][3] ; > > > > The hint were just below there (see comment "Note: in the > > general case, we would have to do:"). > > I propose to patch it since this general form also manages > > the default on-axis case, but Steve should definitely give > > the go-ahead. > > Should someone be concerned about performances I could supply > > a bit larger patch for introducing the ability to supply the > > Context a general perspective matrix, so to have the general > > case only calculated in this eventuality. > > > > > Thanks a lot, > > > > > > Paolo Leoncini > > > > Thanks in advance to a good will updater (John, it's you as usual?). > > > > Paolo Leoncini > > > > > > > -------------------------------------------------------------- > > > ---------------- > > > Download Intel® Parallel Studio Eval Try the new > > software tools > > > for yourself. Speed compiling, find bugs proactively, and fine-tune > > > applications for parallel performance. > > > See why Intel Parallel Studio got high marks during beta. > > > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > > > plib-users mailing list > > > pli...@li... > > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > > > > > > -------------------------------------------------------------- > > ---------------- > > Download Intel® Parallel Studio Eval Try the new > > software tools for yourself. Speed compiling, find bugs > > proactively, and fine-tune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > plib-users mailing list > > pli...@li... > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > -------------------------------------------------------------- > > ---------------- > > Download Intel® Parallel Studio Eval Try the new > > software tools for yourself. Speed compiling, find bugs > > proactively, and fine-tune applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > plib-users mailing list > > pli...@li... > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > >------------------------------------------------------------------------------ > >_______________________________________________ >plib-users mailing list >pli...@li... >https://lists.sourceforge.net/lists/listinfo/plib-users |
From: Laura S. <moo...@gm...> - 2010-04-30 08:18:45
|
Hey Paolo, thank you very much. You're totally right. I forgot to link to the winmm.lib. I'm sorry for this question. Thank you and best regards, Laura -------- Original-Nachricht -------- > Datum: Thu, 29 Apr 2010 16:57:06 +0200 > Von: "Paolo Leoncini" <p.l...@ci...> > An: "\'PLIB Users\'" <pli...@li...> > Betreff: [Plib-users] R: compiling plib with MSVC++ 2005 > Hi Laura, > > > -----Messaggio originale----- > > Da: moo...@gm... [mailto:moo...@gm...] > > Inviato: giovedì 29 aprile 2010 15.27 > > A: pli...@li... > > Oggetto: [Plib-users] compiling plib with MSVC++ 2005 > > > > Hey Guys, > > > > last time I posted a message to this list I asked about Qt. > > Now I changed my programming environment to Microsoft Visual > > Studio 2005. > > > > I compiled the plib with it and it works fine. But when I > > like to compile a project with js.h included and with the > > library path included I get some linker errors. > > > > ******************************************************************* > > js_d.lib(jsWindows.obj) : error LNK2019: unresolved external > > symbol "__imp__joyGetDevCapsA@12" in Funktion ""protected: > > void __thiscall jsJoystick::open(void)" (?open@jsJoystick@@IAEXXZ)". > > > > js_d.lib(jsWindows.obj) : error LNK2019: unresolved external > > symbol "__imp__joyGetNumDevs@0" in Funktion ""public: > > __thiscall jsJoystick::jsJoystick(int)" (??0jsJoystick@@QAE@H@Z)". > > > > js_d.lib(jsWindows.obj) : error LNK2019: unresolved external > > symbol "__imp__joyGetPosEx@8" in Funktion ""public: void > > __thiscall jsJoystick::rawRead(int *,float *)" > > (?rawRead@jsJoystick@@QAEXPAHPAM@Z)". > > > > C:\userdata\VC2005_Projects\Test\Debug\Test.exe : fatal error > > LNK1120: number unresolved externals 3 > > ******************************************************************** > > These functions are in the Windows winmm lib/dll. So just include > winmm.lib > in VC++ among the libraries to link against. > > > Is there a version of plib which is compatible with VC++ > > 2005? Or can anyone help me solving this probs? I'm not a > > really good programmer, but with MSVC 6.0 I used plib as well > > and it was easy to handle. But now I don't know what to do. > > Don't really know. But if it is the only problem you are very close to do > one. > > > Thanks a lot and best regards, > > Laura > > Greetings, > > Paolo Leoncini > > > ------------------------------------------------------------------------------ > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 |
From: Paolo L. <p.l...@ci...> - 2010-04-29 14:57:21
|
Hi Laura, > -----Messaggio originale----- > Da: moo...@gm... [mailto:moo...@gm...] > Inviato: giovedì 29 aprile 2010 15.27 > A: pli...@li... > Oggetto: [Plib-users] compiling plib with MSVC++ 2005 > > Hey Guys, > > last time I posted a message to this list I asked about Qt. > Now I changed my programming environment to Microsoft Visual > Studio 2005. > > I compiled the plib with it and it works fine. But when I > like to compile a project with js.h included and with the > library path included I get some linker errors. > > ******************************************************************* > js_d.lib(jsWindows.obj) : error LNK2019: unresolved external > symbol "__imp__joyGetDevCapsA@12" in Funktion ""protected: > void __thiscall jsJoystick::open(void)" (?open@jsJoystick@@IAEXXZ)". > > js_d.lib(jsWindows.obj) : error LNK2019: unresolved external > symbol "__imp__joyGetNumDevs@0" in Funktion ""public: > __thiscall jsJoystick::jsJoystick(int)" (??0jsJoystick@@QAE@H@Z)". > > js_d.lib(jsWindows.obj) : error LNK2019: unresolved external > symbol "__imp__joyGetPosEx@8" in Funktion ""public: void > __thiscall jsJoystick::rawRead(int *,float *)" > (?rawRead@jsJoystick@@QAEXPAHPAM@Z)". > > C:\userdata\VC2005_Projects\Test\Debug\Test.exe : fatal error > LNK1120: number unresolved externals 3 > ******************************************************************** These functions are in the Windows winmm lib/dll. So just include winmm.lib in VC++ among the libraries to link against. > Is there a version of plib which is compatible with VC++ > 2005? Or can anyone help me solving this probs? I'm not a > really good programmer, but with MSVC 6.0 I used plib as well > and it was easy to handle. But now I don't know what to do. Don't really know. But if it is the only problem you are very close to do one. > Thanks a lot and best regards, > Laura Greetings, Paolo Leoncini |
From: <moo...@gm...> - 2010-04-29 13:26:58
|
Hey Guys, last time I posted a message to this list I asked about Qt. Now I changed my programming environment to Microsoft Visual Studio 2005. I compiled the plib with it and it works fine. But when I like to compile a project with js.h included and with the library path included I get some linker errors. ******************************************************************* js_d.lib(jsWindows.obj) : error LNK2019: unresolved external symbol "__imp__joyGetDevCapsA@12" in Funktion ""protected: void __thiscall jsJoystick::open(void)" (?open@jsJoystick@@IAEXXZ)". js_d.lib(jsWindows.obj) : error LNK2019: unresolved external symbol "__imp__joyGetNumDevs@0" in Funktion ""public: __thiscall jsJoystick::jsJoystick(int)" (??0jsJoystick@@QAE@H@Z)". js_d.lib(jsWindows.obj) : error LNK2019: unresolved external symbol "__imp__joyGetPosEx@8" in Funktion ""public: void __thiscall jsJoystick::rawRead(int *,float *)" (?rawRead@jsJoystick@@QAEXPAHPAM@Z)". C:\userdata\VC2005_Projects\Test\Debug\Test.exe : fatal error LNK1120: number unresolved externals 3 ******************************************************************** Is there a version of plib which is compatible with VC++ 2005? Or can anyone help me solving this probs? I'm not a really good programmer, but with MSVC 6.0 I used plib as well and it was easy to handle. But now I don't know what to do. Thanks a lot and best regards, Laura -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 |
From: Paolo L. <p.l...@ci...> - 2010-04-21 14:41:09
|
John, Please find attached the patch. This patch also include a fix to the function sgQuatToAxisAngle which manages cases of Quat's W outside the range [-1:1] (acos undefined). For this I used _isnan and _finite functions in MS Visual C++, whose availability I ask all of you to verify on other Plib-supported platforms. Otherwise just ignore this second part of the patch. Thanks a lot, Paolo Leoncini > -----Messaggio originale----- > Da: Fay, John F Dr CTR USAF AFMC 46 SK > [mailto:joh...@eg...] > Inviato: sabato 17 aprile 2010 18.33 > A: PLIB Users > Oggetto: Re: [Plib-users] R: culling problems w/ off-axis projection > > Paolo, > > Congratulations and very good on having solved the > problem. Is there a code change that you want me to put into > Subversion? > > Dr. John F. Fay > Technical Fellow > Jacobs Technology TEAS Group > 850-883-1294 > > > -----Original Message----- > From: Paolo Leoncini [mailto:p.l...@ci...] > Sent: Monday, April 12, 2010 3:21 AM > To: 'PLIB Users' > Subject: [Plib-users] R: culling problems w/ off-axis projection > > Dear friends, > > I think to have solved the problem. > > > -----Messaggio originale----- > > Da: p.l...@ci... [mailto:p.l...@ci...] > > Inviato: martedì 6 aprile 2010 11.19 > > A: pli...@li... > > Oggetto: [Plib-users] culling problems w/ off-axis projection > > > > Dear all, > > > > I'm doing off-axis projection (the most general form of > > projection) by translating the four corners of the screen into a > > projection matrix, for which I added a new method to the sgFrustum > > class and to the Context too. The only difference with > giving the six > > frustum extrema values is that no calculation occurs. > Culling seems to > > rely only on the projection matrix values, so, apparently, no > > difference w/ the on-axis standard case. > > > > As far as the projection is not far from the on-axis case > the culling > > gives no problem. Instead when screen position definition > results in a > > large rotation in the projection matrix objects suddenly > disappear and > > reappear by apparently no rule. > > > > Are culling calculations based on a particular form of the > projection > > matrix? > > should culling planes be extracted in a different way to > support the > > more general case? > > In sgFrustum::contains( const sgSphere *s ) (sg.cxx), the for > the non-ortho case which is presently done this way: > > sp1 = plane[ SG_LEFT_PLANE ][0] * center[0] + plane[ > SG_LEFT_PLANE ][2] * center[2] ; > sp2 = plane[ SG_RIGHT_PLANE ][0] * center[0] + plane[ > SG_RIGHT_PLANE ][2] * center[2] ; > sp3 = plane[ SG_BOT_PLANE ][1] * center[1] + plane[ SG_BOT_PLANE > ][2] * center[2] ; > sp4 = plane[ SG_TOP_PLANE ][1] * center[1] + plane[ SG_TOP_PLANE > ][2] * center[2] ; > > should be substituted by the following general form: > > sp1 = sgScalarProductVec3 ( plane[ SG_LEFT_PLANE ], > center ) + plane[ SG_LEFT_PLANE ][3] ; > sp2 = sgScalarProductVec3 ( plane[ SG_RIGHT_PLANE ], > center ) + plane[ SG_RIGHT_PLANE ][3] ; > sp3 = sgScalarProductVec3 ( plane[ SG_BOT_PLANE ], > center ) + plane[ > SG_BOT_PLANE ][3] ; > sp4 = sgScalarProductVec3 ( plane[ SG_TOP_PLANE ], > center ) + plane[ > SG_TOP_PLANE ][3] ; > > The hint were just below there (see comment "Note: in the > general case, we would have to do:"). > I propose to patch it since this general form also manages > the default on-axis case, but Steve should definitely give > the go-ahead. > Should someone be concerned about performances I could supply > a bit larger patch for introducing the ability to supply the > Context a general perspective matrix, so to have the general > case only calculated in this eventuality. > > > Thanks a lot, > > > > Paolo Leoncini > > Thanks in advance to a good will updater (John, it's you as usual?). > > Paolo Leoncini > > > > -------------------------------------------------------------- > > ---------------- > > Download Intel® Parallel Studio Eval Try the new > software tools > > for yourself. Speed compiling, find bugs proactively, and fine-tune > > applications for parallel performance. > > See why Intel Parallel Studio got high marks during beta. > > http://p.sf.net/sfu/intel-sw-dev > > _______________________________________________ > > plib-users mailing list > > pli...@li... > > https://lists.sourceforge.net/lists/listinfo/plib-users > > > > > -------------------------------------------------------------- > ---------------- > Download Intel® Parallel Studio Eval Try the new > software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > > -------------------------------------------------------------- > ---------------- > Download Intel® Parallel Studio Eval Try the new > software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |
From: Fay, J. F Dr C. U. A. 46 S. <joh...@eg...> - 2010-04-17 16:33:13
|
Paolo, Congratulations and very good on having solved the problem. Is there a code change that you want me to put into Subversion? Dr. John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294 -----Original Message----- From: Paolo Leoncini [mailto:p.l...@ci...] Sent: Monday, April 12, 2010 3:21 AM To: 'PLIB Users' Subject: [Plib-users] R: culling problems w/ off-axis projection Dear friends, I think to have solved the problem. > -----Messaggio originale----- > Da: p.l...@ci... [mailto:p.l...@ci...] > Inviato: martedì 6 aprile 2010 11.19 > A: pli...@li... > Oggetto: [Plib-users] culling problems w/ off-axis projection > > Dear all, > > I'm doing off-axis projection (the most general form of > projection) by translating the four corners of the screen > into a projection matrix, for which I added a new method to > the sgFrustum class and to the Context too. The only > difference with giving the six frustum extrema values is that > no calculation occurs. Culling seems to rely only on the > projection matrix values, so, apparently, no difference w/ > the on-axis standard case. > > As far as the projection is not far from the on-axis case the > culling gives no problem. Instead when screen position > definition results in a large rotation in the projection > matrix objects suddenly disappear and reappear by apparently no rule. > > Are culling calculations based on a particular form of the > projection matrix? > should culling planes be extracted in a different way to > support the more general case? In sgFrustum::contains( const sgSphere *s ) (sg.cxx), the for the non-ortho case which is presently done this way: sp1 = plane[ SG_LEFT_PLANE ][0] * center[0] + plane[ SG_LEFT_PLANE ][2] * center[2] ; sp2 = plane[ SG_RIGHT_PLANE ][0] * center[0] + plane[ SG_RIGHT_PLANE ][2] * center[2] ; sp3 = plane[ SG_BOT_PLANE ][1] * center[1] + plane[ SG_BOT_PLANE ][2] * center[2] ; sp4 = plane[ SG_TOP_PLANE ][1] * center[1] + plane[ SG_TOP_PLANE ][2] * center[2] ; should be substituted by the following general form: sp1 = sgScalarProductVec3 ( plane[ SG_LEFT_PLANE ], center ) + plane[ SG_LEFT_PLANE ][3] ; sp2 = sgScalarProductVec3 ( plane[ SG_RIGHT_PLANE ], center ) + plane[ SG_RIGHT_PLANE ][3] ; sp3 = sgScalarProductVec3 ( plane[ SG_BOT_PLANE ], center ) + plane[ SG_BOT_PLANE ][3] ; sp4 = sgScalarProductVec3 ( plane[ SG_TOP_PLANE ], center ) + plane[ SG_TOP_PLANE ][3] ; The hint were just below there (see comment "Note: in the general case, we would have to do:"). I propose to patch it since this general form also manages the default on-axis case, but Steve should definitely give the go-ahead. Should someone be concerned about performances I could supply a bit larger patch for introducing the ability to supply the Context a general perspective matrix, so to have the general case only calculated in this eventuality. > Thanks a lot, > > Paolo Leoncini Thanks in advance to a good will updater (John, it's you as usual?). Paolo Leoncini > -------------------------------------------------------------- > ---------------- > Download Intel® Parallel Studio Eval Try the new > software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ plib-users mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-users |
From: Paolo L. <p.l...@ci...> - 2010-04-12 08:21:37
|
Dear friends, I think to have solved the problem. > -----Messaggio originale----- > Da: p.l...@ci... [mailto:p.l...@ci...] > Inviato: martedì 6 aprile 2010 11.19 > A: pli...@li... > Oggetto: [Plib-users] culling problems w/ off-axis projection > > Dear all, > > I'm doing off-axis projection (the most general form of > projection) by translating the four corners of the screen > into a projection matrix, for which I added a new method to > the sgFrustum class and to the Context too. The only > difference with giving the six frustum extrema values is that > no calculation occurs. Culling seems to rely only on the > projection matrix values, so, apparently, no difference w/ > the on-axis standard case. > > As far as the projection is not far from the on-axis case the > culling gives no problem. Instead when screen position > definition results in a large rotation in the projection > matrix objects suddenly disappear and reappear by apparently no rule. > > Are culling calculations based on a particular form of the > projection matrix? > should culling planes be extracted in a different way to > support the more general case? In sgFrustum::contains( const sgSphere *s ) (sg.cxx), the for the non-ortho case which is presently done this way: sp1 = plane[ SG_LEFT_PLANE ][0] * center[0] + plane[ SG_LEFT_PLANE ][2] * center[2] ; sp2 = plane[ SG_RIGHT_PLANE ][0] * center[0] + plane[ SG_RIGHT_PLANE ][2] * center[2] ; sp3 = plane[ SG_BOT_PLANE ][1] * center[1] + plane[ SG_BOT_PLANE ][2] * center[2] ; sp4 = plane[ SG_TOP_PLANE ][1] * center[1] + plane[ SG_TOP_PLANE ][2] * center[2] ; should be substituted by the following general form: sp1 = sgScalarProductVec3 ( plane[ SG_LEFT_PLANE ], center ) + plane[ SG_LEFT_PLANE ][3] ; sp2 = sgScalarProductVec3 ( plane[ SG_RIGHT_PLANE ], center ) + plane[ SG_RIGHT_PLANE ][3] ; sp3 = sgScalarProductVec3 ( plane[ SG_BOT_PLANE ], center ) + plane[ SG_BOT_PLANE ][3] ; sp4 = sgScalarProductVec3 ( plane[ SG_TOP_PLANE ], center ) + plane[ SG_TOP_PLANE ][3] ; The hint were just below there (see comment "Note: in the general case, we would have to do:"). I propose to patch it since this general form also manages the default on-axis case, but Steve should definitely give the go-ahead. Should someone be concerned about performances I could supply a bit larger patch for introducing the ability to supply the Context a general perspective matrix, so to have the general case only calculated in this eventuality. > Thanks a lot, > > Paolo Leoncini Thanks in advance to a good will updater (John, it's you as usual?). Paolo Leoncini > -------------------------------------------------------------- > ---------------- > Download Intel® Parallel Studio Eval Try the new > software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |
From: <p.l...@ci...> - 2010-04-06 10:19:04
|
Dear all, I'm doing off-axis projection (the most general form of projection) by translating the four corners of the screen into a projection matrix, for which I added a new method to the sgFrustum class and to the Context too. The only difference with giving the six frustum extrema values is that no calculation occurs. Culling seems to rely only on the projection matrix values, so, apparently, no difference w/ the on-axis standard case. As far as the projection is not far from the on-axis case the culling gives no problem. Instead when screen position definition results in a large rotation in the projection matrix objects suddenly disappear and reappear by apparently no rule. Are culling calculations based on a particular form of the projection matrix? should culling planes be extracted in a different way to support the more general case? Thanks a lot, Paolo Leoncini |
From: John F. F. <joh...@cy...> - 2010-03-25 23:09:26
|
Laura, Hello and welcome to the PLIB community. I don't have Qt on my machine but I can tell you how things are defined on my Windows XP box with MSVC 6.0. I selected the "go to the definition of LoadLibrary" and find the following. <quote> #define LoadLibrary LoadLibraryA </quote> Tracking back: <quote> WINBASEAPI HMODULE WINAPI LoadLibraryA( LPCSTR lpLibFileName </quote> ); <quote> typedef CONST CHAR *LPCSTR, *PCSTR; </quote> <quote> #define CONST const </quote> <quote> typedef char CHAR; </quote> So it looks like Windows/MSVC defines the argument simply to be a "const char *". Did you put the "*" in your explicit cast? - John At 08:46 AM 3/24/2010, you wrote: >Hello, > >I like to use the Joystick library from Plib in >a Qt Project. Up to now I used VC++ 6.0 with >Plib and it works fine. Now I want to use it with Qt but don't know how. > > >I do some changes to my .pro file: > >INCLUDEPATH = C:/plib-1.8.5/src/js C:/plib-1.8.5/src/util > >win32:LIBS += >C:/plib-1.8.5/src/js/Debug/js_d.lib C:/plib-1.8.5/src/util/Debug/ul_d.lib > > >and in main.cpp I do: > >#include <js.h> > > >But when I compile then I get an error: > >..\..\plib-1.8.5\src\util/ul.h:554: error: >cannot convert 'char*' to 'const WCHAR*' for >argument '1' to 'HINSTANCE__* LoadLibraryW(const WCHAR*)' > > >I change line 554 in ul.h from: > >handle = (HMODULE) LoadLibrary ( dllname ) ; > >into: > >handle = (HMODULE) LoadLibrary ( (const WCHAR) dllname ) ; > >but this doesn't work too and I get 3 new errors. > > >I don't know what to do more now. Can anybody >help me getting plib run in my Qt project? Would be very nice. > >Best regards > >Laura >-- >GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.! >http://portal.gmx.net/de/go/dsl02 > >------------------------------------------------------------------------------ >Download Intel® Parallel Studio Eval >Try the new software tools for yourself. Speed compiling, find bugs >proactively, and fine-tune applications for parallel performance. >See why Intel Parallel Studio got high marks during beta. >http://p.sf.net/sfu/intel-sw-dev >_______________________________________________ >plib-users mailing list >pli...@li... >https://lists.sourceforge.net/lists/listinfo/plib-users |