Re: [Plib-users] Help for code that is not documented and isconfusing
Brought to you by:
sjbaker
From: Dimitris M. <dm...@ya...> - 2007-07-24 21:25:16
|
I think that PLib is certainly a fine job, and being so alive after so many= years prooves that this lib is to continue.=0AI do not understand why an e= ngine like this hadn't so far to deal seriously with the problem of picking= and selecting.=0AFor me is very essential a solution to find. How could I = choose among many ships on the battlefield what I want and look up statisti= cs for example? With a combobox ? ( I had this alternative thinking ;-) But= this is no way a game-spirit solution right? It's..desktop solution.=0A=0A= If in anycase, I can help I would love to help.=0A=0AP.S. Plib needs docume= ntation if it is to go on...my opinion...As far as I see, a lot of you peop= le from the list must be pros in the 3D area...So you have a plus against p= eople like me :-( so docs are necessary...even more I think...=0A=0A=0A----= - Original Message ----=0AFrom: Tinoshi Kitazawa <ti...@li...>=0ATo: = PLIB Users <pli...@li...>=0ASent: Wednesday, July 25, 2= 007 12:10:59 AM=0ASubject: Re: [Plib-users] Help for code that is not docum= ented and isconfusing=0A=0A=0A=0A=0A =0A=0AHello,=0A=0A=0A=0AI've been dea= ling with point picking using plib a lot for my thesis...=0AIt is a pain...= I needed to have some Sim City like scenario' s builder=0Afor my flight si= mulator (select an object, and place it on the 3d map=0Ajust clicking with = the mouse...), and even if now it works fine, I'm=0Asure it is not optimize= d at all... :-) If you think this would help,=0AI'll probably try to find t= he code and send it to you on your private=0Aemail... Let me know!=0A=0A=0A= =0AP.S. Do you think this object picking thing is something to include in= =0Athe plib? ssgObjectPicker or something like that, that takes mouse=0Acoo= rds and returns the closest object/point of the scene we are=0Apointing to?= Maybe it is considered an high level feature plib will=0Anever implement, = what do you think about it?=0A=0A=0A=0ADimitris Mexis ha scritto:=0A=0A sg= SetVec3( HOTvec, 0.0f, 0.0f, -my_position[2] + HOT_TOLERANCE )=0Aif you do = -my_position look like my_position and even if you have setup my_position[0= ] and [1] as non-negative numbers the object spins around z axis looking fr= om me to the distance far away.=0AIf you touch the minus sign in my_positio= n[0] and [1] only and let the minus in the sgSetVec3, all seems ok...=0ABiz= zare..isn't it?=0A=0A----- Original Message ----=0AFrom: Fay John F Dr CTR = USAF 46 SK <joh...@eg...>=0ATo: PLIB Users <plib-users@lists.s= ourceforge.net>=0ASent: Tuesday, July 24, 2007 11:10:45 PM=0ASubject: Re: [= Plib-users] Help for code that is not documented and isconfusing=0A=0ADimit= ris,=0A=0A If you downloaded the PLIB package, the PointPicker is in the= =0A"examples" directory. (I shouldn't have called it a "demo"; I always=0A= get those confused.)=0A=0A I do not know what you mean by the sentence t= hat starts "I tried=0Aalso to inverse the elements of this matrix inv[..]".= Did you change=0Athe signs on the translation parts or did you try to exc= hange the=0Aindices on the left-hand side of the equals sign? What results= did you=0Aget?=0A=0AJohn F. Fay=0ATechnical Fellow=0AJacobs Technology TEA= S Group=0A850-883-1294 =0A=0A-----Original Message-----=0AFrom: plib-users-= bo...@li...=0A[mailto:pli...@li...urceforg= e.net] On Behalf Of Dimitris=0AMexis=0ASent: Tuesday, July 24, 2007 2:57 PM= =0ATo: PLIB Users=0ASubject: Re: [Plib-users] Help for code that is not doc= umented and=0Aisconfusing=0A=0AYes you are right, about the division, and t= he assumptions you made have=0Aa meaning.=0AThe PointPicker? I don;t have t= his tutorial!!! Can you send it to me=0Aplz?=0AI tried also to inverse the = elements of this matrix inv[..], only those=0Aapart from [2]. Because if yo= u touch the [2] dimension=0Athe result is awful...=0A=0AWhat to say, I am v= ery thankfull for your help, John.=0A=0A----- Original Message ----=0AFrom:= Fay John F Dr CTR USAF 46 SK <joh...@eg...>=0ATo: PLIB Users = <pli...@li...>=0ASent: Tuesday, July 24, 2007 10:41:34 = PM=0ASubject: Re: [Plib-users] Help for code that is not documented and is= =0Aconfusing=0A=0ADimitris,=0A=0A A few more answers:=0A=0A The "= PointPicker" demo program in PUI has a "point and=0Aclick" capability to se= lect an object. You start the program, click=0Atwice in the gray input box= , and then right-click on one of the square=0A"points" in the main window. = When you first start the program you have=0Ato click twice in the input bo= x before trying to select a point, but=0Aafter the first time you only need= to click once; I do not know why this=0Ais. The selected point turns red = and its point number appears in the=0Ainput box.=0A=0A In your code = snippet, I do not know why the inverse=0Amatrix is being used. I think the= minus signs are related to the fact=0Athat it is an inverse matrix; the re= d book on page 478 gives the matrix=0Ain question. I also don't know wheth= er "hot" is "height of terrain" or=0A"height over terrain". In the first c= ase it would be the altitude of=0Athe terrain above some zero point; in the= second case it would be the=0Aheight of your point over the terrain. I do= know that "hgt" is short=0Afor "height". The "for ( int i" loop is steppi= ng through all the hits=0Areturned by the "ssgHOT" call and finding the one= with the greatest=0Aheight. Again, I'm not sure why the code sets " hgt = =3D - h->plane[3] /=0Ah->plane[2]" since using the homogeneous coordinates = (page 476 of the=0Ared book) I would expect " hgt =3D - h->plane[2] / h->pl= ane[3]".=0A=0AJohn F. Fay=0ATechnical Fellow=0AJacobs Technology TEAS Group= =0A850-883-1294 =0A=0A-----Original Message-----=0AFrom: plib-users-bounces= @lists.sourceforge.net=0A[mailto:pli...@li...] = On Behalf Of Dimitris=0AMexis=0ASent: Monday, July 23, 2007 4:42 PM=0ATo: p= lib...@li...=0ASubject: [Plib-users] Help for code that = is not documented and is=0Aconfusing=0A=0AHello people, I am trying to stud= y plib and do some tricks with it, I=0Afound code for doing things. No dice= nt documentation though. So=0Aeverything I tried I did it blindly....=0ACan= some one help me with the code snippets below ?=0A=0AFIRST :=0A=0A /* L= ook for the nearest polygon *beneath* my_position */=0A float HOT_TOLERA= NCE =3D 1.0f;=0A ssgHit *results;=0A int num_hits;=0A float hot; = /* H.O.T =3D=3D Height Of Terrain */=0A sgVec3 HOTvec;=0A sgMat4 invm= at;=0A sgMakeIdentMat4( invmat );=0A invmat[3][0] =3D - my_position[0= ];=0A invmat[3][1] =3D - my_position[1];=0A invmat[3][2] =3D 0.0f;=0A= =0A sgSetVec3( HOTvec, 0.0f, 0.0f, -my_position[2] + HOT_TOLERANCE=0A);/= /FIXME I don't know why I use minus here!!=0A num_hits =3D ssgHOT( scene= , HOTvec, invmat, &results );=0A hot =3D DEEPEST_HELL;=0A for ( int i= =3D 0; i < num_hits; i++ ) {=0A ssgHit *h =3D &results[i];=0A = float hgt =3D - h->plane[3] / h->plane[2];=0A if ( hgt >=3D hot ) = {=0A hot =3D hgt;=0A if ( normal !=3D NULL )=0A = sgCopyVec3( normal, h->plane );=0A }=0A }=0A return = hot;=0A}=0A=0ABesides the fact that I took as "global constant" the code, I= didn;t=0Aunderstand why the inverse matrix! ?=0AWhat is supposed to do ?= =0A=0Alower You see a FIXME, it is mine, and yes what does this line do ?= =0AIf I have a 3000polygon coming against 5000 polygons of another surface,= =0Athe for loop, goes all this around to seek the collition?=0AWhat is, rea= lly ssgHit, and the division with float hgt ?=0A=0ANext I want to ask about= the code in PPE about picking...To tell you the=0Atruth I read OpenGL book= about glLoadName* but I don't see how that=0Awould fit here when I load a = model and not drawing vertices....=0AHas anyone tried to draw something in = 3D from his mouse click? e.g. the=0Aray and try to intercect with the objec= ts in the scenery?=0AOR has anyone achieved to point and click an object ? = I haven't seen=0Acode to do that from plib...apart ppe, which ppe neither c= ompiles nor=0Ahas some remarks to understand it's stuff...=0A=0ACrying for = help...=0ADimitris=0A=0AThank you=0A=0A=0A=0A=0A =0A_________________= _______________________________________________________=0A____________=0AMo= ody friends. Drama queens. Your life? Nope! - their life, your story.=0APla= y Sims Stories at Yahoo! Games.=0Ahttp://sims.yahoo.com/ =0A=0A-----------= -------------------------------------------------------------=0A-=0AThis SF= .net email is sponsored by: Splunk Inc.=0AStill grepping through log files = to find problems? Stop.=0ANow Search log events and configuration files us= ing AJAX and a browser.=0ADownload your FREE copy of Splunk now >> http://= get.splunk.com/=0A_______________________________________________=0Aplib-us= ers mailing list=0Ap...@li...=0Ahttps://lists.sourcef= orge.net/lists/listinfo/plib-users=0A=0A-----------------------------------= -------------------------------------=0A-=0AThis SF.net email is sponsored = by: Splunk Inc.=0AStill grepping through log files to find problems? Stop.= =0ANow Search log events and configuration files using AJAX and a browser.= =0ADownload your FREE copy of Splunk now >> http://get.splunk.com/=0A_____= __________________________________________=0Aplib-users mailing list=0Aplib= -u...@li...=0Ahttps://lists.sourceforge.net/lists/listinfo= /plib-users=0A=0A=0A=0A=0A=0A =0A____________________________________= ____________________________________=0A____________=0ANeed a vacation? Get = great deals=0Ato amazing places on Yahoo! Travel.=0Ahttp://travel.yahoo.com= /=0A=0A--------------------------------------------------------------------= ----=0A-=0AThis SF.net email is sponsored by: Splunk Inc.=0AStill grepping = through log files to find problems? Stop.=0ANow Search log events and conf= iguration files using AJAX and a browser.=0ADownload your FREE copy of Splu= nk now >> http://get.splunk.com/=0A_______________________________________= ________=0Aplib-users mailing list=0Ap...@li...=0Ahtt= ps://lists.sourceforge.net/lists/listinfo/plib-users=0A=0A-----------------= --------------------------------------------------------=0AThis SF.net emai= l is sponsored by: Splunk Inc.=0AStill grepping through log files to find p= roblems? Stop.=0ANow Search log events and configuration files using AJAX = and a browser.=0ADownload your FREE copy of Splunk now >> http://get.splun= k.com/=0A_______________________________________________=0Aplib-users maili= ng list=0Ap...@li...=0Ahttps://lists.sourceforge.net/= lists/listinfo/plib-users=0A=0A=0A=0A=0A=0A =0A______________________= ______________________________________________________________=0ASick sense= of humor? Visit Yahoo! TV's =0AComedy with an Edge to see what's on, when.= =0Ahttp://tv.yahoo.com/collections/222=0A=0A------------------------------= -------------------------------------------=0AThis SF.net email is sponsore= d by: Splunk Inc.=0AStill grepping through log files to find problems? Sto= p.=0ANow Search log events and configuration files using AJAX and a browser= .=0ADownload your FREE copy of Splunk now >> http://get.splunk.com/=0A____= ___________________________________________=0Aplib-users mailing list=0Apli= b-...@li...=0Ahttps://lists.sourceforge.net/lists/listinf= o/plib-users=0A=0A =0A=0A=0A=0A-- =0A=0AVisitate www.tinoshi.altervista.or= g!=0AOgni giorno nuove strip!!!=0A=0A=0A=0A=0A=0A=0A=0A =0A__________= __________________________________________________________________________= =0AYahoo! oneSearch: Finally, mobile search =0Athat gives answers, not web = links. =0Ahttp://mobile.yahoo.com/mobileweb/onesearch?refer=3D1ONXIC |