plib-devel Mailing List for PLIB (Page 342)
Brought to you by:
sjbaker
You can subscribe to this list here.
2000 |
Jan
|
Feb
(80) |
Mar
(128) |
Apr
(111) |
May
(157) |
Jun
(70) |
Jul
(116) |
Aug
(465) |
Sep
(574) |
Oct
(325) |
Nov
(163) |
Dec
(182) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(167) |
Feb
(191) |
Mar
(319) |
Apr
(118) |
May
(252) |
Jun
(427) |
Jul
(187) |
Aug
(96) |
Sep
(219) |
Oct
(161) |
Nov
(109) |
Dec
(210) |
2002 |
Jan
(97) |
Feb
(80) |
Mar
(143) |
Apr
(234) |
May
(72) |
Jun
(246) |
Jul
(155) |
Aug
(280) |
Sep
(418) |
Oct
(81) |
Nov
(72) |
Dec
(88) |
2003 |
Jan
(59) |
Feb
(63) |
Mar
(33) |
Apr
(27) |
May
(87) |
Jun
(50) |
Jul
(97) |
Aug
(45) |
Sep
(35) |
Oct
(67) |
Nov
(78) |
Dec
(13) |
2004 |
Jan
(167) |
Feb
(144) |
Mar
(172) |
Apr
(93) |
May
(43) |
Jun
(7) |
Jul
(27) |
Aug
(36) |
Sep
(48) |
Oct
(54) |
Nov
(5) |
Dec
(44) |
2005 |
Jan
(53) |
Feb
(36) |
Mar
(13) |
Apr
(3) |
May
(19) |
Jun
|
Jul
(49) |
Aug
(39) |
Sep
(8) |
Oct
(8) |
Nov
(51) |
Dec
(23) |
2006 |
Jan
(26) |
Feb
(5) |
Mar
(26) |
Apr
(26) |
May
(52) |
Jun
(36) |
Jul
(8) |
Aug
(12) |
Sep
(6) |
Oct
(75) |
Nov
(34) |
Dec
(25) |
2007 |
Jan
(46) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(7) |
Jul
(2) |
Aug
|
Sep
(40) |
Oct
(9) |
Nov
(3) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(26) |
Apr
|
May
|
Jun
(2) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
|
Nov
(5) |
Dec
(2) |
2009 |
Jan
(63) |
Feb
(4) |
Mar
(12) |
Apr
|
May
(5) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joel U. <joe...@ya...> - 2000-07-27 15:45:56
|
> Dave McClurg wrote: > > > "Vallevand, Mark K" wrote: > > > > > > Steve, are you planning on collecting some neat stuff into PLIB? > An > > > auxiliary library of stuff. I have a few small, useful classes > that > > > someone else might find handy. The auxiliary library would > > be a good > > > places to put collections of textures, wav files, mod files > > and models. > > > > When you get back, Steve, I wonder about something like this for the > > > more complex primtives for PPE - sphere/cylinder that sort of thing. > I > > think that they might be better in an auxillary library to ssg, > which > > builds onto the features of ssg. > > > > Just a suggestion to save all this continual adding to ssg simply > for > > PPE. > > > > Bye - Joel. > > Is the KeyFlier something that could be moved out of ssg into the > auxillary library? > > --Dave Makes sense to me, but Steve might disagree. Bye - Joel. |
From: Dave M. <Dav...@dy...> - 2000-07-27 00:21:54
|
I fixed ssgLoadASE so it uses ssgVtxArray. This significantly lowers the # of verticies and should speed things up for large models --Dave |
From: Dave M. <Dav...@dy...> - 2000-07-26 14:38:20
|
> "Vallevand, Mark K" wrote: > > > > Steve, are you planning on collecting some neat stuff into PLIB? An > > auxiliary library of stuff. I have a few small, useful classes that > > someone else might find handy. The auxiliary library would > be a good > > places to put collections of textures, wav files, mod files > and models. > > When you get back, Steve, I wonder about something like this for the > more complex primtives for PPE - sphere/cylinder that sort of thing. I > think that they might be better in an auxillary library to ssg, which > builds onto the features of ssg. > > Just a suggestion to save all this continual adding to ssg simply for > PPE. > > Bye - Joel. Is the KeyFlier something that could be moved out of ssg into the auxillary library? --Dave |
From: Joel U. <joe...@ya...> - 2000-07-26 07:04:43
|
"Vallevand, Mark K" wrote: > > Steve, are you planning on collecting some neat stuff into PLIB? An > auxiliary library of stuff. I have a few small, useful classes that > someone else might find handy. The auxiliary library would be a good > places to put collections of textures, wav files, mod files and models. When you get back, Steve, I wonder about something like this for the more complex primtives for PPE - sphere/cylinder that sort of thing. I think that they might be better in an auxillary library to ssg, which builds onto the features of ssg. Just a suggestion to save all this continual adding to ssg simply for PPE. Bye - Joel. |
From: Dave M. <Dav...@dy...> - 2000-07-25 02:25:43
|
According to the PLIB readme.win32: Borland C++: ~~~~~~~~~~~~ "Heil, David G. SDX" <Da...@HP...> contributed a set of Borland bpg/bpr files. I know nothing more about what may be required in order to use them. If that doesn't help, you should look at Makefile.am in each of the src folders. They list the files in each library. Using that information, it should be pretty straigh-forward to compile them on any system. To get started quickly, just throw all the files in one folder and link them together without libraries. Good luck, --Dave > Does anyone have plib pre-compiled for windowz? Or maybe some > makefiles for > the free Borland compiler. I want to try and port my GL apps > to windowz you > see, but without plib under windows I'm kinda stuck. > > Thanks in advance, > > Arthur. |
From: Paolo L. <p.l...@ci...> - 2000-07-25 02:17:53
|
I can just put at your disposal the plib 1.2 *Cygnus* .a libs (B20.1, thus compiled with g++/gcc 2.95.2) - so if you like you can pick these at ftp://ftp.cira.it/paolo/plib/lib/cygnus/. These just require Cygwin1, Glut32, GLU32, OpenGL32 dlls. Anyway you can freely contact me if you plan to switch to Cygnus on Windows. ---------------------------------------------------------------------------- - Paolo Leoncini phone: +39 (0823) 623134 Scientific Visualization Group fax: +39 (0823) 623126 CIRA - Italian Center for Aerospace Researches p.l...@ci... Via Maiorise - 81043 Capua (CE) Italy www.cira.it/research/vis > -----Messaggio originale----- > Da: pli...@li... > [mailto:pli...@li...]Per conto di Arthur > Yarwood > Inviato: lunedì 24 luglio 2000 12.22 > A: pli...@li... > Oggetto: [Plib-devel] anyone have plib for windows? > > > Does anyone have plib pre-compiled for windowz? Or maybe some > makefiles for > the free Borland compiler. I want to try and port my GL apps to > windowz you > see, but without plib under windows I'm kinda stuck. > > Thanks in advance, > > Arthur. > > > _______________________________________________ > plib-devel mailing list > pli...@li... > http://lists.sourceforge.net/mailman/listinfo/plib-devel > |
From: Wolfram K. <w_...@rz...> - 2000-07-25 02:06:59
|
Dave wrote: > M(3,0) = -eyex; M(3,1) = -eyey; M(3,2) = -eyez; M(3,3) = 1.0; I think this is wrong. This is done differently in Mesa, Mesa uses an extra glTranslate. People wanting to use this code with plib should check this. Bye bye, Wolfram Kuss. |
From: Vallevand, M. K <Mar...@UN...> - 2000-07-25 01:45:55
|
Steve, are you planning on collecting some neat stuff into PLIB? An auxiliary library of stuff. I have a few small, useful classes that someone else might find handy. The auxiliary library would be a good places to put collections of textures, wav files, mod files and models. Regards. Mark K Vallevand ma...@rs... Never try and teach a pig to sing: it's a waste of time, and it annoys the pig. |
From: Arthur Y. <u97...@bo...> - 2000-07-24 10:20:44
|
Does anyone have plib pre-compiled for windowz? Or maybe some makefiles for the free Borland compiler. I want to try and port my GL apps to windowz you see, but without plib under windows I'm kinda stuck. Thanks in advance, Arthur. |
From: Wolfram K. <w_...@rz...> - 2000-07-22 17:54:50
|
I just compiled all the projects from the workspace that is supplied with plib. I had no problems with pui or sl. The sl-project does NOT contain slHack.cxx. However, no os-project is included. Bye bye, Wolfram Kuss. |
From: <Va...@t-...> - 2000-07-22 16:07:49
|
Hi, I wanted to compile PLIB with MSVC (using my own workspace) and got some problems. - in os/DynLib.cpp MSVC couldn't find a "Pch.h" or a "Os.h". So I uncommented them. - after changing "__WIN32__" to "_WIN32" I could finally compile DynLib.cpp - pu.h made some problems as I had to define GLUT_IS_PRESENT. Couldn't we make it the default by changing the top of pu.h from: #ifndef PU_NOT_USING_GLUT # ifdef FREEGLUT_IS_PRESENT # include <GL/freeglut.h> # else # ifdef GLUT_IS_PRESENT # include <GL/glut.h> # else /* No GLUT?!? */ # endif # endif #endif to: #ifndef PU_NOT_USING_GLUT # ifdef FREEGLUT_IS_PRESENT # include <GL/freeglut.h> # else # include <GL/glut.h> # endif #endif - sl/slhack.cxx has a few functions that don't return a value although they have to. This happens in the lines 690, 704, 765 and 789. This also breakes MSVC. CU, Christian |
From: Steve B. <sjb...@ai...> - 2000-07-21 01:02:51
|
Steve Baker wrote: > Risto S Varanka wrote: > > Btw, do people often have problems with the joystick support? Almost never. 99% of PLIB problems are of the "My OpenGL isn't installed right" kind. > > Maybe the example could have more diagnostic features, Yes - it should. The example programs are kinda sad, unloved packages - it's very unglamorous to work on them - but it needs to be done. > chgrm root /dev/js{0,1} ^^^^^ Ooops! That should have been 'chgrp'! -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Steve B. <sjb...@ai...> - 2000-07-21 00:54:44
|
Risto S Varanka wrote: > > Thanks for help, Stephen! My joystick works just nice in the JS example > as well now, and I'm one happy hacker. (If only I got my OpenGL > working too ;) > > I'm sorry to disappoint you, but it was a simple permission > problem. I had overlooked the obvious :) Btw, do people often > have problems with the joystick support? Maybe the example could > have more diagnostic features, like in my case it could have said: > "No permissions to use joystick /dev/js0. The permissions on file > /dev/js0 are "rw-rw----" - is this correct?" No. rw-rw---- only grants permission to the 'owner' of /dev/js0 - who is presumably 'root' - and to members of the 'group' that /dev/js0 belongs to - which is presumably also 'root'. Other users who are not 'root' or members of the 'root' group will be denied permission to read or write it. You need crw-rw-rw-. Log in as 'root' (or run 'su') and type: chown root /dev/js{0,1} chgrm root /dev/js{0,1} chmod a+rw /dev/js{0,1} ...just to be sure. On my machine: > ls -l /dev/js* crw-rw-rw- 1 root root 15, 0 Mar 11 04:11 /dev/js0 crw-rw-rw- 1 root root 15, 1 Mar 11 04:11 /dev/js1 -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Stephen J B. <sj...@li...> - 2000-07-20 16:13:45
|
Several people have asked about SigGraph...I guess quite a few of us developer types will be there and it would be cool if we could meet up somewhere. The most obvious place would be the informal Birds Of a Feather (BOF) meetings for Linux/OpenGL/Mesa: | * OpenGL Birds of a Feather - 7/26 | 6:30PM - 8 PM Hilton Hotel, Napoleon | Room, 3rd Floor. | | * Linux 3D Birds of a Feather 7/27 | 6:30PM - 8 PM Hilton Riverside, | Versaille Ballroom. I plan to attend both of those - it would be nice to get some face-to-face contact and instanciate some of those 'virtual beers' that I've been promised! :-) Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |
From: Risto S V. <rva...@cc...> - 2000-07-20 09:49:52
|
Thanks for help, Stephen! My joystick works just nice in the JS example as well now, and I'm one happy hacker. (If only I got my OpenGL working too ;) I'm sorry to disappoint you, but it was a simple permission problem. I had overlooked the obvious :) Btw, do people often have problems with the joystick support? Maybe the example could have more diagnostic features, like in my case it could have said: "No permissions to use joystick /dev/js0. The permissions on file /dev/js0 are "rw-rw----" - is this correct?" -- Risto Varanka | http://www.helsinki.fi/~rvaranka/ ris...@he... |
From: Risto S V. <rva...@cc...> - 2000-07-19 14:13:08
|
I noticed I sent my message to the wrong list accidentally (this would really belong to plib-users I gather), sorry about that. Anyways, here's some additional info. Originally I used the version 1.0.20 of Plib, then I upgraded to 1.2.0, but the problem still persists: fun13:/usr/src/plib-1.2.0/examples/plib_examples-1.1.8/examples/js$ ./js_demo Joystick test program. ~~~~~~~~~~~~~~~~~~~~~ Joystick 0 not detected Joystick 1 not detected I am using Debian Potato with version 2.2.15 of the kernel, and joystick driver v1.2.15. -- Risto Varanka ris...@he... http://www.helsinki.fi/~rvaranka/Linux.html |
From: Stephen J B. <sj...@li...> - 2000-07-19 13:15:03
|
Risto S Varanka wrote: > My joystick (CH Combatstick) works fine in Linux itself, but not > with Plib's JS. The joy-analog module loads fine with the correct > parameters, and it works perfectly in jstest. However, the JS > example program says that no joysticks are found. (notWorking > returns true.) > > What could be the problem? How can I investigate it? I haven't yet > tried other programs or hacking the Plib code. (I didn't get > joystick working with one of my own Plib experiments, though.) That's certainly an unusual problem. I havn't heard of anyone with that kind of a problem before. Hence, I'm rather at a loss to know what to suggest - so here are a bunch of questions that might show up something useful: * When you ran './configure' on PLIB, did it say that it had detected 'linux/joystick.h' or did it say that 'joystick.h' had been found? It *should* be linux/joystick.h for Linux systems - if it isn't then there is something wrong with your installation of the joystick drivers. * That being the case, could you look in /usr/include/linux/joystick.h and tell me what 'JS_VERSION' is defined as. grep JS_VERSION /usr/include/linux/joystick.h ...should do the trick. * Also, could you tell me which version of PLIB you have and what Linux distribution and Kernel version you are running. * Is it possible that the joystick header file and your joystick driver are out of sync? Have you ever upgraded either of them? * Does the file /dev/js0 exist? Does it have '-rw-rw-rw' permissions? If you *really* want to investigate this some more by digging around in the code, I would add: if ( fd < 0 ) { perror("JS-open") ; exit(1) ; } ...just after: fd = ::open ( fname, O_RDONLY | O_NONBLOCK ) ; ...on about line 176 of src/js/js.h in PLIB. That will let us see whether the joystick device is being opened correctly (I suspect it is not - but I don't know why not). If it *is* being opened correctly then...I'm *really* puzzled...there are three possibilities: If you have the old joystick driver (unlikely) then I can't imagine what could be wrong. If the system *thinks* you have the old driver - but you actually have the new driver - or vice-versa then who knows what crap could be happening. (Hence my questions about headers and upgrades). If you have the new joystick driver (I think you must have since the old one wasn't called 'joy-analog' IIRC) then perhaps the 'ioctl' on lines 219 and 220 are somehow not returning. Hmmm - I should be checking for error there and I'm not...*BAD* programmer :-) Add: if ( errno != 0 ) perror("JS-ioctl"); ...after each ioctl and the fcntl, then print out: fprintf(stderr, "Axes=%d Buttons=%d\n", num_axes, num_buttons ) ; ...and let's see exactly what it detected. Good luck - and *please* let me know what you find. Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@li... http://www.link.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |
From: Risto S V. <rva...@cc...> - 2000-07-19 11:42:25
|
Hi My joystick (CH Combatstick) works fine in Linux itself, but not with Plib's JS. The joy-analog module loads fine with the correct parameters, and it works perfectly in jstest. However, the JS example program says that no joysticks are found. (notWorking returns true.) What could be the problem? How can I investigate it? I haven't yet tried other programs or hacking the Plib code. (I didn't get joystick working with one of my own Plib experiments, though.) -- Risto Varanka | http://www.helsinki.fi/~rvaranka/ ris...@he... |
From: Dave M. <Dav...@dy...> - 2000-07-18 23:43:19
|
Steve wrote : > > i was thinking that ssgSelector would replace the bitset with > > an array of bools. select() would be rewritten as: > > > > void select ( unsigned int s ) > > { > > for ( int i=0; i<max_kids && i<32; i++ ) > > selection [i] = ( (1<<i) & s ) != 0 ; > > } > > > > does that work for you? > > Do you want me to do this BTW? If you are not > already 'on the case', I could get it done in an > hour or so - maybe tonight. > it's all yours. i'll pound on the Blender VRML loader tonite. --Dave |
From: Steve B. <sjb...@ai...> - 2000-07-18 22:08:40
|
> Dave McClurg wrote: > > Steve wrote: > > > ssgSelector would allow more than 32 frames by adding a > > > max_kids param to the constructor > > > > What about the current ability (which I use quite a bit) to > > pass an integer mask with one bit per child object to > > enable you to select multiple child objects at once? > > > i was thinking that ssgSelector would replace the bitset with > an array of bools. select() would be rewritten as: > > void select ( unsigned int s ) > { > for ( int i=0; i<max_kids && i<32; i++ ) > selection [i] = ( (1<<i) & s ) != 0 ; > } > > does that work for you? Do you want me to do this BTW? If you are not already 'on the case', I could get it done in an hour or so - maybe tonight. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Steve B. <sjb...@ai...> - 2000-07-18 22:07:03
|
> Dave McClurg wrote: > > Steve wrote: > > > ssgSelector would allow more than 32 frames by adding a > > > max_kids param to the constructor > > > > What about the current ability (which I use quite a bit) to > > pass an integer mask with one bit per child object to > > enable you to select multiple child objects at once? > > > i was thinking that ssgSelector would replace the bitset with > an array of bools. select() would be rewritten as: > > void select ( unsigned int s ) > { > for ( int i=0; i<max_kids && i<32; i++ ) > selection [i] = ( (1<<i) & s ) != 0 ; > } > > does that work for you? We need to preserve the current functionality of 'select(unsigned int)' then - and add a new 'select(unsigned int *)' to allow you to pass an array of select bits or something. Yep - that'll work. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net |
From: Dave M. <Dav...@dy...> - 2000-07-18 15:15:28
|
Steve wrote: > > ssgSelector would allow more than 32 frames by adding a > > max_kids param to the constructor > > What about the current ability (which I use quite a bit) to > pass an integer mask with one bit per child object to > enable you to select multiple child objects at once? > i was thinking that ssgSelector would replace the bitset with an array of bools. select() would be rewritten as: void select ( unsigned int s ) { for ( int i=0; i<max_kids && i<32; i++ ) selection [i] = ( (1<<i) & s ) != 0 ; } does that work for you? > Yes - but there are times when frame-locked synchronisation > is *CRITICAL*. > > One example is in a weather simulation model we have at work that does > lightning bolts... cool example. i'll have to remember that. > > Please tell me your thoughts > > Wibble, wibble, wibble. > > -- You did ask. :-) > lol. --Dave McClurg |
From: Dave M. <Dav...@dy...> - 2000-07-18 14:54:55
|
rather than translate into an ssg XYZ - HPR coord structure why not just set the camera matrix? i hacked this from LookAt in Mesa-3.2/src-glu/glu.c but i haven't tested it yet void ssgLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz ) { sgMat4 m; GLdouble x[3], y[3], z[3]; GLdouble mag; /* Make rotation matrix */ /* Z vector */ z[0] = eyex - centerx; z[1] = eyey - centery; z[2] = eyez - centerz; mag = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] ); if (mag) { /* mpichler, 19950515 */ z[0] /= mag; z[1] /= mag; z[2] /= mag; } /* Y vector */ y[0] = upx; y[1] = upy; y[2] = upz; /* X vector = Y cross Z */ x[0] = y[1]*z[2] - y[2]*z[1]; x[1] = -y[0]*z[2] + y[2]*z[0]; x[2] = y[0]*z[1] - y[1]*z[0]; /* Recompute Y = Z cross X */ y[0] = z[1]*x[2] - z[2]*x[1]; y[1] = -z[0]*x[2] + z[2]*x[0]; y[2] = z[0]*x[1] - z[1]*x[0]; /* mpichler, 19950515 */ /* cross product gives area of parallelogram, which is < 1.0 for * non-perpendicular unit-length vectors; so normalize x, y here */ mag = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] ); if (mag) { x[0] /= mag; x[1] /= mag; x[2] /= mag; } mag = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] ); if (mag) { y[0] /= mag; y[1] /= mag; y[2] /= mag; } #define M(row,col) m[row][col] M(0,0) = x[0]; M(0,1) = x[1]; M(0,2) = x[2]; M(0,3) = 0.0; M(1,0) = y[0]; M(1,1) = y[1]; M(1,2) = y[2]; M(1,3) = 0.0; M(2,0) = z[0]; M(2,1) = z[1]; M(2,2) = z[2]; M(2,3) = 0.0; M(3,0) = -eyex; M(3,1) = -eyey; M(3,2) = -eyez; M(3,3) = 1.0; #undef M ssgSetCamera( m ) ; } > Last I looked I didn't see anything like this, but what I would really > like is some code that would take a directional vector and an up > vector and translate this into an ssg XYZ - HPR coord structure. > > What I'd like to use this for is given I know my camera position, and > the position of something I want centered on the screen, I want to > look directly at it (with control over the up direction.) For > example, a chase plane view in a flight sim. > > It's probably a simple thing to impliment, but I just haven't had a > chance to sit down and think it through ... and if someone has already > done the work I'd happily use that. :-) > > Regards, > > Curt. |
From: Curtis L. O. <cu...@me...> - 2000-07-18 14:36:35
|
Last I looked I didn't see anything like this, but what I would really like is some code that would take a directional vector and an up vector and translate this into an ssg XYZ - HPR coord structure. What I'd like to use this for is given I know my camera position, and the position of something I want centered on the screen, I want to look directly at it (with control over the up direction.) For example, a chase plane view in a flight sim. It's probably a simple thing to impliment, but I just haven't had a chance to sit down and think it through ... and if someone has already done the work I'd happily use that. :-) Regards, Curt. Wolfram Kuss writes: > BTW, I game developers might use this code as well. > I use it for camera-movement (when I do a "make object fully > visible"). > Its quite simple, but perhaps you want to put it into plib? > > Here is the function: > > --------------------- cut ------------------------------ > void /*sg*/Vec3fromHPR ( sgVec3 vec3, const sgVec3 hpr ) > // If hpr are the hpr of the camera, then this function gives the > normalised > // viewing direction. Of course roll is lost in this conversion. > { > double ch, sh, cp, sp; > > if ( hpr[0] == SG_ZERO ) > { > ch = SGD_ONE ; > sh = SGD_ZERO ; > } > else > { > sh = (SGfloat) sin( (double)( hpr[0] * SG_DEGREES_TO_RADIANS )) ; > ch = (SGfloat) cos( (double)( hpr[0] * SG_DEGREES_TO_RADIANS )) ; > } > > if ( hpr[1] == SG_ZERO ) > { > cp = SGD_ONE ; > sp = SGD_ZERO ; > } > else > { > sp = sin( (double)( hpr[1] * SG_DEGREES_TO_RADIANS )) ; > cp = cos( (double)( hpr[1] * SG_DEGREES_TO_RADIANS )) ; > } > vec3[0] = (SGfloat)( -sh * cp ) ; > vec3[1] = (SGfloat)( ch * cp ) ; > vec3[2] = (SGfloat)( sp ) ; > // rest is check > sgVec3 hprCheck; > sgHPRfromVec3 ( hprCheck, vec3) ; > if(0.01<abs(hprCheck[0]-hpr[0])) > fprintf(stderr,"\n*** Heading: %f vs %f***\n",hprCheck[0],hpr[0]); > if(0.01<abs(hprCheck[1]-hpr[1])) > fprintf(stderr,"\n*** Pitch: %f vs %f ***\n",hprCheck[1],hpr[1]); > > > } > --------------------- cut ------------------------------ > > Bye bye, > Wolfram Kuss. > > > _______________________________________________ > plib-devel mailing list > pli...@li... > http://lists.sourceforge.net/mailman/listinfo/plib-devel -- Curtis Olson Human Factors Research Lab Flight Gear Project Twin Cities cu...@hf... cu...@fl... Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org |
From: Wolfram K. <w_...@rz...> - 2000-07-18 09:39:50
|
I have a trivial question: If I am in a slightly ascending aeroplane, is my pitch positive? I would guess so, but looking at void sgHPRfromVec3 ( sgVec3 hpr, const sgVec3 src ) at the line hpr[1] = -(SGfloat) atan2 ( tmp [ 2 ], sqrt ( sgSquare ( tmp [ 0 ] ) + sgSquare ( tmp [ 1 ] ) ) ) * SG_RADIANS_TO_DEGREES ; it seems to be negative, is that correct? Here is the reason for my question: While sg contains a function to convert a cartesian Vec3 into a HPR, the other conversion was missing and I implemented it for PPE by copying code from sgMakeCoordMat4. It seems to work in PPE, but when I converted the result back as a check, I get inverted pitch. Is the bug in my new function or in plib, for example sgHPRfromVec3 ? BTW, I game developers might use this code as well. I use it for camera-movement (when I do a "make object fully visible"). Its quite simple, but perhaps you want to put it into plib? Here is the function: --------------------- cut ------------------------------ void /*sg*/Vec3fromHPR ( sgVec3 vec3, const sgVec3 hpr ) // If hpr are the hpr of the camera, then this function gives the normalised // viewing direction. Of course roll is lost in this conversion. { double ch, sh, cp, sp; if ( hpr[0] == SG_ZERO ) { ch = SGD_ONE ; sh = SGD_ZERO ; } else { sh = (SGfloat) sin( (double)( hpr[0] * SG_DEGREES_TO_RADIANS )) ; ch = (SGfloat) cos( (double)( hpr[0] * SG_DEGREES_TO_RADIANS )) ; } if ( hpr[1] == SG_ZERO ) { cp = SGD_ONE ; sp = SGD_ZERO ; } else { sp = sin( (double)( hpr[1] * SG_DEGREES_TO_RADIANS )) ; cp = cos( (double)( hpr[1] * SG_DEGREES_TO_RADIANS )) ; } vec3[0] = (SGfloat)( -sh * cp ) ; vec3[1] = (SGfloat)( ch * cp ) ; vec3[2] = (SGfloat)( sp ) ; // rest is check sgVec3 hprCheck; sgHPRfromVec3 ( hprCheck, vec3) ; if(0.01<abs(hprCheck[0]-hpr[0])) fprintf(stderr,"\n*** Heading: %f vs %f***\n",hprCheck[0],hpr[0]); if(0.01<abs(hprCheck[1]-hpr[1])) fprintf(stderr,"\n*** Pitch: %f vs %f ***\n",hprCheck[1],hpr[1]); } --------------------- cut ------------------------------ Bye bye, Wolfram Kuss. |