plib-users Mailing List for PLIB (Page 50)
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: Underwood S. C. <sun...@kn...> - 2002-07-25 21:00:23
|
<< Maybe you can use your code the calculate the camera positions and give that to ssgContext? >> I had considered doing that, but I am trying to avoid rewriting the camera code I have already written. My current camera class simply maintains the "eye,center,up" vectors that are provided to gluLookAt, rather than directly handling the matrix transformations. I've mainly done this for readability reasons. <<PLIB also has "LookAt" etc routines.>> I'll be buggered if I can figure out where they are. . . I'm not seeing anything in SSG or SG. I'll take a look at the PrettyPoly code and try to rip something. |
From: Wolfram K. <w_...@rz...> - 2002-07-25 09:00:20
|
Generally speaking, you can mix "pure" OpenGL calls and PLIB, but it is better to use PLIB code, if that is available. About the camera, see the ssgContext: http://plib.sourceforge.net/ssg/ssgContext.html Maybe you can use your code the calculate the camera positions and give that to ssgContext? Another possibility is to use the camera code from PPE ( http://prettypoly.sf.net ). It is GPLed. PLIB also has "LookAt" etc routines. Bye bye, Wolfram. |
From: Underwood S. C. <sun...@kn...> - 2002-07-25 01:17:56
|
Hi all. I am working on my first app using plib. It's a modification of an existing OpenGL test program that loads a scene containing four cubes and allows the user to move the camera with the keyboard. I changed it to use ssg to load and draw files in DXF format. Unfortunately, I seem to no longer be able to move the camera using my original camera class, which I'd like to keep. I'm wondering, does the ssg library's ssgCullAndDraw() function do anything that might hijack control of the camera, and if so, can I disable that, or do I have to switch to using plib to control the viewpoint? Thanks -Bastian |
From: Wolfram K. <w_...@rz...> - 2002-07-24 22:57:35
|
I do not understand whether=20 a) your model has colour or texture, but this is lost during loading or b) the model does not have colour / texture and you want to add colour from the program. Do you get any error messages while loading the 3DS file? Bye bye, Wolfram. |
From: Allen Y. <ay...@wr...> - 2002-07-24 21:51:33
|
Hi, I used ssgLoad3ds to load my 3ds object into the scene. The object only shows white color. Now I try to add the different color to it. I don't have any luck so far. Can anyone show me how to do it? The following code I used to load 3ds file if(m_OS == NULL) m_OS = new ssgTransform; ssgModelPath ( "../data" ) ; ssgTexturePath ( "../data" ) ; OS_obj = ssgLoad3ds ("latestSEAWOLF.3DS"); m_OS->addKid ( OS_obj ) ; ssgFlatten ( OS_obj ) ; ssgStripify ( m_OS ) ; return m_OS; Thank you for help. |
From: <Rol...@t-...> - 2002-07-23 07:21:28
|
Hello, I would like to draw a puButton with a texture on it. Somehow it reflects the color of the texture, i.e. if I use a dark blue marble image the button has a flat dark blue surface, but I cannot see the texture itself. What am I doing wrong ? I use the following to create textured button : puImageButton.h: #ifndef INCL_PUIMAGEBUTTON_H #define INCL_PUIMAGEBUTTON_H #include <plib/pu.h> #include <plib/ssg.h> class puImageButton : public puButton { public: puImageButton(int,int,int,int,const char *); void draw(int dx,int dy); protected: ssgTexture *texture; }; #endif puImageButton.cpp: #include "puImageButton.h" #include <iostream.h> puImageButton::puImageButton(int minx,int miny,int maxx,int maxy,const char *image) : puButton(minx,miny,maxx,maxy) { texture=new ssgTexture(image); cerr << "texture handle : " << texture->getHandle() << endl; } void puImageButton::draw(int dx,int dy) { if (!visible || (window!=puGetWindow())) return; puButton::draw(dx,dy); int m=4; glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture->getHandle()); glColor4f(1.0,1.0,1.0,1.0); glBegin(GL_QUADS); glTexCoord2f(dx+abox.min[0]+m,dy+abox.min[1]+m); // top left glVertex2i(dx+abox.min[0]+m,dy+abox.min[1]+m); glTexCoord2f(dx+abox.min[0]+m,dy+abox.max[1]-m); // bottom left glVertex2i(dx+abox.min[0]+m,dy+abox.max[1]-m); glTexCoord2f(dx+abox.max[0]-m,dy+abox.max[1]-m); // bottom right glVertex2i(dx+abox.max[0]-m,dy+abox.max[1]-m); glTexCoord2f(dx+abox.max[0]-m,dy+abox.min[1]+m); // top right glVertex2i(dx+abox.max[0]-m,dy+abox.min[1]+m); glEnd(); glDisable(GL_TEXTURE_2D); } and finally in the main program after puInit(): new puImageButton(SCREEN_WIDTH-75,11,SCREEN_WIDTH-11,75,"data/key.rgb"); When called it outputs: texture handle : 2 so, the texture should have been loaded ok. Thanks for hints, Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: Reed H. <re...@ze...> - 2002-07-22 17:17:55
|
> I'd bet actual money that you have OpenGL installed in a 'creative' > location > on your machine instead of the official /usr/lib/libGL and > /usr/include/GL/gl.h > ...99% of the time that's the problem. Yeah. configure scripts won't look in /usr/local/include or /usr/local/lib by default, by the way, but you can add such non-standard paths to environment variables CPPFLAGS and LDFLAGS before running configure. |
From: Steve B. <sjb...@ai...> - 2002-07-20 02:16:03
|
Dave Perry wrote: > When configuring plib from the "current.tgz" file, I get the error: > configure: error: could not find working GL library > > I do not ge any error when I configure plib-1.4.2. Also, I am running > FlightGear from a current cvs tar ball, so I know Open GL is working. Am > I missing some switch when I run > ./autogen.sh > to set up for the ./configure, make, make install. > > I need the current.tgz plib to get the features from the FlightGear cvs > tarball. Well, I just did a 'diff' between current.tgz and the current CVS contents and they are *identical* - however, what you get from the current development version (either via the tarball or via CVS) is somewhat different from a released copy of PLIB because you have to run the autoconf/automake steps yourself. I don't see how that could cause your problem though. The next step is to look in config.log and see what error message the compiler generated when it failed to compile/link to OpenGL...hopefully that'll point the way to the root cause of your problems. I'd bet actual money that you have OpenGL installed in a 'creative' location on your machine instead of the official /usr/lib/libGL and /usr/include/GL/gl.h ...99% of the time that's the problem. ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: Dave P. <ski...@mi...> - 2002-07-20 01:50:14
|
When configuring plib from the "current.tgz" file, I get the error: configure: error: could not find working GL library I do not ge any error when I configure plib-1.4.2. Also, I am running FlightGear from a current cvs tar ball, so I know Open GL is working. Am I missing some switch when I run ./autogen.sh to set up for the ./configure, make, make install. I need the current.tgz plib to get the features from the FlightGear cvs tarball. Any help will be appreciated. Dave |
From: Steve B. <sjb...@ai...> - 2002-07-19 21:29:42
|
Rolf Jakob wrote: > Is there an optimization to kill nearby vertexes ? Yes - I think someone must have added something like that. I just created a very tiny cube in AC3D - and when I load it into PPE (a PLIB-based modeller), it comes out as a flat rectangle. > I have quite small characters (~0.61 in height) and after some changes to the > model one hand shows up as only two lines when loaded into plib. In the > modeller (AC3D) it's ok. Also a two sided mesh partly disappears depending on > the camera angle. > > Is there an absolute threshold I should consider when drawing small things ? Evidently. Does anyone want to confess to making this change? If so, the threshold needs to be **MUCH** smaller. ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: Steve B. <sjb...@ai...> - 2002-07-19 21:07:53
|
I find your code extremely confusing to read - I can't tell what you *intended* to do - so it's hard to be precise about what you did wrong. However, I don't think you understand what an ssgSelector does. I suspect you should be declaring a single ssgSelector, loading two models and attaching them both as children of that selector, then doing a 'selectStep(0)' or a 'selectStep(1)' to decide which of them will be rendered...but it's not clear that this is what you actually wanted to do. Allen Yang wrote: > ssgTransform *COSBranch::ReplaceShipMode(BOOL &shipMode) > { > if(m_OS == NULL) > m_OS = new ssgTransform; > > ssgModelPath ( "../data" ) ; > ssgTexturePath ( "../data" ) ; > > if (m_pStateSub == NULL ) > m_pStateSub = new ssgSelector[2]; ^^^^^^^^^^^^^^^^^^^ Do you really want TWO ssgSelectors? > OS_obj = ssgLoad3ds ("latestSEAWOLF.3DS"); > OS_obj2 = ssgLoad3ds ("02carrier.3DS"); > > > m_pStateSub[0].addKid(OS_obj); > m_pStateSub[1].addKid(OS_obj2); So now you've added one child object into each of those two selectors. Hence, you have two selectors - each with one child node. > if (!shipMode) > { > m_pStateSub->selectStep(1); ^^^^^^^^^^^^^^^^ This doesn't look right...shouldn't you be selecting one element of the array? I'd expect you to have written: m_pStateSub[0].selectStep( <something> ) ; But selectStep(1) selects a step that doesn't exist - because only step 0 has been set up for each selector??!?! > m_OS->addKid(&m_pStateSub[1]); So now you've added just one of the two selector nodes into the transform - and hence only one is every connected into the scene graph and you wasted all that effort loading the other file unnecessarily. > } > else { > m_pStateSub->selectStep(0); > > m_OS->addKid(&m_pStateSub[0]); > } > > return m_OS; > } If you only intend to load one or the other model into the scene, you don't need an ssgSelector - but if you switch between the two models at runtime, then you need to add both models into one ssgSelector - so why did you declare two of them?? I'm very confused about what you want to do. ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: Allen Y. <ay...@wr...> - 2002-07-18 21:44:42
|
Hi, I have a question about using ssgSelector. I set up menu selections for the user so they can switch differnt objects. in my main root class: I am doing the following things: scene1 is ssgRoot. if (!m_OS_flag) { scene1->addKid(m_pOSBranch->ReplaceShipMode(shipMode)); m_OS_flag = TRUE; } if ((shipMode) != (m_shipMode_flag)) { scene1->addKid(m_pOSBranch->ReplaceShipMode(shipMode)); m_shipMode_flag = shipMode; } m_pOSBranch->update_OS_motion(localX,localY, localZ, Heading); In my ship class, I try to load the different objects based on the user's request: ssgEntity *OS_obj2, *OS_obj; ssgTransform *COSBranch::ReplaceShipMode(BOOL &shipMode) { if(m_OS == NULL) m_OS = new ssgTransform; ssgModelPath ( "../data" ) ; ssgTexturePath ( "../data" ) ; if (m_pStateSub == NULL ) m_pStateSub = new ssgSelector[2]; OS_obj = ssgLoad3ds ("latestSEAWOLF.3DS"); OS_obj2 = ssgLoad3ds ("02carrier.3DS"); m_pStateSub[0].addKid(OS_obj); m_pStateSub[1].addKid(OS_obj2); if (!shipMode) { m_pStateSub->selectStep(1); m_OS->addKid(&m_pStateSub[1]); } else { m_pStateSub->selectStep(0); m_OS->addKid(&m_pStateSub[0]); } return m_OS; } My problem is that the old object didn't get deleted when the new objects load into the scene. How can I solve the problem? Please help me out |
From: Steve B. <sjb...@ai...> - 2002-07-17 01:49:19
|
Allen Yang wrote: > I tried to use ssgSimpleState class to load different 3ds files based on the > user's request. Eh? I think you are a bit confused. ssgSimpleState is for holding OpenGL state - thing like texture, material properties,etc. For loading models, use ssgLoad("filename"); To switch between models at runtime, create an ssgSelector object and attach the two loaded models using an ssgSelector::addKid(child_object) for each of them - then you can select which one will be drawn using ssgSelector::selectStep(0) or ssgSelector::selectStep(1). ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: Allen Y. <ay...@wr...> - 2002-07-16 18:23:45
|
Hi, I tried to use ssgSimpleState class to load different 3ds files based on the user's request. However, I couldn't make it work at all. It won't load 3ds files. I was wondering if there is anyway I can use ssgSimpleState class to load 3ds files. I am attaching my code here. if (m_pState == NULL ) m_pState = new ssgStateSelector(2); if (m_pSub == NULL) m_pSub = new ssgSimpleState; if (m_pCarrier == NULL) m_pCarrier = new ssgSimpleState; m_pState->setStep(0, m_pSub); m_pState->setStep(1, m_pCarrier); m_pSub = ssgLoad3ds ("latestSEAWOLF.3DS"); m_pCarrier = ssgLoad3ds ("02carrier.3DS"); ssgLeaf *OS_obj ->setState(m_pState); ssgLeaf *carrier_obj ->setState(m_pState); if (!carrier) m_pState->selectStep(0); else m_pState->selectStep(1); m_OS->addKid ( OS_obj ) ; ssgFlatten ( OS_obj ) ; ssgStripify ( m_OS ) ; Thank you for help. |
From: <Rol...@t-...> - 2002-07-15 20:31:08
|
Hello, Is there an optimization to kill nearby vertexes ? I have quite small characters (~0.61 in height) and after some changes to the model one hand shows up as only two lines when loaded into plib. In the modeller (AC3D) it's ok. Also a two sided mesh partly disappears depending on the camera angle. Is there an absolute threshold I should consider when drawing small things ? Currently the smallest distance between vertexes is about 0.005. Thanks, Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: <Rol...@t-...> - 2002-07-13 12:07:32
|
Hi, It's now working as expected. There was a problem with the tweened model. What exactly the problem was I cannot tell. I just reload the scene and the bones into exposer, set the save option again to one bank per second and saved the tweened model. Using a very simplistic test program I saw the animation. Without any modifications I tried it again in the game and it worked. I have to create lots of tweened models, so maybe I come across the problem again and find out how to reproduce. I now have animated models and I can transform them in the scene. A very big step for the planned game. Many thanks for your help, Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: Steve B. <sjb...@ai...> - 2002-07-13 00:04:36
|
Rolf Jakob wrote: > So, you only have a ssgTweenController. That's what ExPoser puts at the top of the scene sub-graph it generates...so that's what you'll get back from ssgLoad. > I tried again and removed the ssgTransform, so that I have : > > ssgTweenController *femme_obj; > femme_obj=new ssgTweenController; > femme_obj->addKid(ssgLoadSSG("player-female_tweened.ssg")); > scene->addKid(femme_obj); > > float bank=(frameno%140)/14.0; > femme_obj->selectBank(bank); > cerr << femme_obj->getTypeName() << " bank : " << bank << endl; > > It's an ssgTweenController now, but it won't move. *sigh* Well, you can certainly put the ssgTweenController *under* an ssgTransform. Your original code seemed to do that OK: > > ssgTransform *femme=0; > > ssgEntity *femme_obj; > > > > // init > > femme=new ssgTransform; > > femme_obj=ssgLoadSSG("player-female_tweened.ssg"); > > femme->addKid(femme_obj); > > sgCoord fc; > > sgSetCoord(&fc,1.67,0.126,0,90,0,0); > > femme->setTransform(&fc); > > scene->addKid(femme); So femme_obj is the ssgTweenController and femme is the transform. Diagramatically, you had: scene (ssgRoot) | femme (ssgTransform) | femme_obj (ssgTweenController) | ...other stuff... ...which seems OK - I don't understand how come it's not working. > Before your reply I checked another thing: I used to have a ssgEntity casted > to a ssgTweenController when needed. That's OK. > I turned it around so that I have a > ssgTweenController and the result of ssgLoadSSG is casted once. That showed > the exact same result. Indeed - that's what you'd expect. >>..so I think you are basically doing the right thing - you must have >>a bug somewhere. I guess you should do: >> >> cerr << femme->getTypeName() << endl ; > > femme is a ssgTransform, femme_obj was a ssgRoot in my first example. Eh? No - 'scene' is the root, femme is the transform and femme_obj is the ssgTweenController. Er - right. Sorry, I meant to suggest: cerr << femme_obj->getTypeName() << endl ; ^^^^ So we can be sure that ExPoser actually *did* write out what we expected it to. > With the modifications above (no ssgTransform) a femme_obj->print() reads: > Current Bank = 0.000000 > ssgTweenController: Name=NoName > Userdata = (nil) > Num Parents=0 EH? No parents?!? That suggests that it's not connected into the scene graph. > Hmmm, I'm supposed to use the file exposer writes directly without any further > modifications, right ? Yes - although if you had a 3D modeller (PrettyPoly for example) that understood SSG-format files - then you *could* go and hand-edit what ExPoser generated. > PS: I put the current snapshot of the program and everything needed on my > home page, just in case somebody is interested in it and wants to take a look > at it. It's a beginning of a OLRPG with server and client, multiple scenes > and hopefully some walking characters - somewhen ;-) Perhaps a simpler test program is needed? ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: <Rol...@t-...> - 2002-07-11 12:28:16
|
On Thursday 11 July 2002 20:03, Steve Baker wrote: > Rolf Jakob wrote: > > I try to get a tween controller to work with the current CVS snapshot. > > What I did : > > Used exposer to have some animation and saved a tweened model with a bank > > every second. > > Load the model using ssgLoadSSG resulting to a hierarchy starting with an > > ssgEntity. In fact this should be a ssgTweenController. > > Well, ssgEntity is an abstract base class in SSG - you can't have a 'pure' > ssgEntity - it's always some kind of derived class. > > > Create a ssgTransform and add the tween controller as a kid to be able to > > transform the model in the scene. > > Use the ssgTransform for transformation and the ssgTweenController for > > the animation (this one has to be casted from ssgEntity). > > The animation has the default length of 10 seconds, so I should have 10 > > banks. > > Sounds reasonable. > > > The problem is I cannot see the model moving, it's always in its first > > position. A debug shows that the bank selecting factor travels from 0.0 > > to somewhere near 10 and restarts at 0.0, so that should be ok. > > Indeed. > > > I'm quite sure I miss something very simple, but what ? > > Is the way I got the model into the scene the way it should be ? Is the > > type of the root node preserved from exposer through a ssgLoadSSG() ? > > Yes - it should be. > > > Code sniplets: > > // global > > ssgTransform *femme=0; > > ssgEntity *femme_obj; > > > > // init > > femme=new ssgTransform; > > femme_obj=ssgLoadSSG("player-female_tweened.ssg"); > > femme->addKid(femme_obj); > > sgCoord fc; > > sgSetCoord(&fc,1.67,0.126,0,90,0,0); > > femme->setTransform(&fc); > > scene->addKid(femme); > > > > // redraw > > float bank=(frameno%140)/14.0; > > ((ssgTweenController *)femme_obj)->selectBank(bank); > > cerr << "bank : " << bank << endl; > > Well, that *looks* OK. > > One of my programs does this: > > body_tween = new ssgTweenController () ; > body_tween -> addKid ( ssgLoad ( "body.ssg" , loader_opts ) ) ; > > ..and then... > > void update_motion () > { > static int frameno = 0 ; > > frameno++ ; > > body_tween -> selectBank ( (float)frameno/100.0 ) ; > } So, you only have a ssgTweenController. I tried again and removed the ssgTransform, so that I have : ssgTweenController *femme_obj; femme_obj=new ssgTweenController; femme_obj->addKid(ssgLoadSSG("player-female_tweened.ssg")); scene->addKid(femme_obj); float bank=(frameno%140)/14.0; femme_obj->selectBank(bank); cerr << femme_obj->getTypeName() << " bank : " << bank << endl; It's an ssgTweenController now, but it won't move. *sigh* Before your reply I checked another thing: I used to have a ssgEntity casted to a ssgTweenController when needed. I turned it around so that I have a ssgTweenController and the result of ssgLoadSSG is casted once. That showed the exact same result. > ..so I think you are basically doing the right thing - you must have > a bug somewhere. I guess you should do: > > cerr << femme->getTypeName() << endl ; femme is a ssgTransform, femme_obj was a ssgRoot in my first example. With the modifications above (no ssgTransform) a femme_obj->print() reads: Current Bank = 0.000000 ssgTweenController: Name=NoName Userdata = (nil) Num Parents=0 Num Kids=1 BSphere is Empty. ssgRoot: Name=NoName So, there is still this ssgRoot like it was before, only that it has a ssgTweenController as a parent. Some more lines: Userdata = (nil) Num Parents=1 Num Kids=1 BSphere R=0.360757, C=(-0.00305547,0.0112409,0.284257) ssgBranch: Name=NoName Userdata = (nil) Num Parents=1 Num Kids=1 BSphere R=0.360757, C=(-0.00305547,0.0112409,0.284257) ssgBranch: Name=NoName Userdata = (nil) Num Parents=1 Num Kids=16 BSphere R=0.360757, C=(-0.00305547,0.0112409,0.284257) ssgBranch: Name=LStiefel Userdata = (nil) Num Parents=1 Num Kids=4 BSphere R=0.130889, C=(-0.0273403,0.00357434,0.148229) ssgBranch: Name=convexhull Userdata = (nil) Num Parents=1 Num Kids=4 BSphere R=0.0362996, C=(-0.0276763,-0.0419187,0.13792) ssgTween: Name=NoName Down there is the first ssgTween. Hmmm, I'm supposed to use the file exposer writes directly without any further modifications, right ? Again out of ideas, Rolf PS: I put the current snapshot of the program and everything needed on my home page, just in case somebody is interested in it and wants to take a look at it. It's a beginning of a OLRPG with server and client, multiple scenes and hopefully some walking characters - somewhen ;-) -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: Steve B. <sjb...@ai...> - 2002-07-11 01:04:11
|
Rolf Jakob wrote: > I try to get a tween controller to work with the current CVS snapshot. What I > did : > Used exposer to have some animation and saved a tweened model with a bank > every second. > Load the model using ssgLoadSSG resulting to a hierarchy starting with an > ssgEntity. In fact this should be a ssgTweenController. Well, ssgEntity is an abstract base class in SSG - you can't have a 'pure' ssgEntity - it's always some kind of derived class. > Create a ssgTransform and add the tween controller as a kid to be able to > transform the model in the scene. > Use the ssgTransform for transformation and the ssgTweenController for the > animation (this one has to be casted from ssgEntity). > The animation has the default length of 10 seconds, so I should have 10 banks. Sounds reasonable. > The problem is I cannot see the model moving, it's always in its first > position. A debug shows that the bank selecting factor travels from 0.0 to > somewhere near 10 and restarts at 0.0, so that should be ok. Indeed. > I'm quite sure I miss something very simple, but what ? > Is the way I got the model into the scene the way it should be ? Is the type > of the root node preserved from exposer through a ssgLoadSSG() ? Yes - it should be. > Code sniplets: > // global > ssgTransform *femme=0; > ssgEntity *femme_obj; > > // init > femme=new ssgTransform; > femme_obj=ssgLoadSSG("player-female_tweened.ssg"); > femme->addKid(femme_obj); > sgCoord fc; > sgSetCoord(&fc,1.67,0.126,0,90,0,0); > femme->setTransform(&fc); > scene->addKid(femme); > > // redraw > float bank=(frameno%140)/14.0; > ((ssgTweenController *)femme_obj)->selectBank(bank); > cerr << "bank : " << bank << endl; Well, that *looks* OK. One of my programs does this: body_tween = new ssgTweenController () ; body_tween -> addKid ( ssgLoad ( "body.ssg" , loader_opts ) ) ; ...and then... void update_motion () { static int frameno = 0 ; frameno++ ; body_tween -> selectBank ( (float)frameno/100.0 ) ; } ...so I think you are basically doing the right thing - you must have a bug somewhere. I guess you should do: cerr << femme->getTypeName() << endl ; ...to be sure that you really have an ssgTweenController. ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: <Rol...@t-...> - 2002-07-09 19:59:07
|
On Sunday 07 July 2002 14:58, Rolf Jakob wrote: > On Sunday 07 July 2002 06:03, ha...@sl... wrote: > > If I remember right, ssgLOS in the released version only calls ssgHOT. > > I believe this has been corrected in the CVS version of plib, however. > > Oh, thanks, that would explain the effect. I'll give the CVS version a try. > Ok, the CVS version shows a different effect, but still not exactly what I need. The documentation says : "ssgLOS intersects an arbitary vector whose direction is defined by 's'. " So I defined a vector with length 1.0 pointing to the direction according to the camera angle. It comes up with intersections very near to the camera. After multiplying it with 10.0 it intersects with objects farther away, but it will miss the ones directly in front of me. It seems the length of the "direction vector" matters, but it looks like it's more an intersection of a point rather than a line starting from the camera with a specified or infinite length. Is there an example for the usage of ssgLOS ? Thanks, Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: <Rol...@t-...> - 2002-07-09 17:47:18
|
On Tuesday 09 July 2002 11:08, Steve Baker wrote: > Sebastian Ude wrote: > > On Tue, 2 Jul 2002, Rol...@t-... (Rolf Jakob) wrote: > >>Date: Tue, 2 Jul 2002 20:49:46 +0000 > >>To: "'pli...@li...'" > >><pli...@li...> > >>From: Rol...@t-... (Rolf Jakob) > >>Subject: [Plib-users] exposer and CVS plib > >> > >>Hello, > >> > >>My guess is for using exposer to create animations I need the latest CVS > >>snapshot ? > > > > Dunno - Steve could tell, but he is on vacation. > > Yes - but I'm back now. > > I don't recall whether ExPoser worked with 1.5 - I suspect you'll need the > version in CVS. I'm currently using it and with the CVS snapshot from Monday night it works nicely. Now I just have to get the animation going - see my other posting. Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: <Rol...@t-...> - 2002-07-09 17:35:40
|
Hi, I try to get a tween controller to work with the current CVS snapshot. What I did : Used exposer to have some animation and saved a tweened model with a bank every second. Load the model using ssgLoadSSG resulting to a hierarchy starting with an ssgEntity. In fact this should be a ssgTweenController. Create a ssgTransform and add the tween controller as a kid to be able to transform the model in the scene. Use the ssgTransform for transformation and the ssgTweenController for the animation (this one has to be casted from ssgEntity). The animation has the default length of 10 seconds, so I should have 10 banks. The problem is I cannot see the model moving, it's always in its first position. A debug shows that the bank selecting factor travels from 0.0 to somewhere near 10 and restarts at 0.0, so that should be ok. I'm quite sure I miss something very simple, but what ? Is the way I got the model into the scene the way it should be ? Is the type of the root node preserved from exposer through a ssgLoadSSG() ? Code sniplets: // global ssgTransform *femme=0; ssgEntity *femme_obj; // init femme=new ssgTransform; femme_obj=ssgLoadSSG("player-female_tweened.ssg"); femme->addKid(femme_obj); sgCoord fc; sgSetCoord(&fc,1.67,0.126,0,90,0,0); femme->setTransform(&fc); scene->addKid(femme); // redraw float bank=(frameno%140)/14.0; ((ssgTweenController *)femme_obj)->selectBank(bank); cerr << "bank : " << bank << endl; Thanks, Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: Steve B. <sjb...@ai...> - 2002-07-09 00:59:53
|
Sebastian Ude wrote: > > On Tue, 2 Jul 2002, Rol...@t-... (Rolf Jakob) wrote: > >>Date: Tue, 2 Jul 2002 20:49:46 +0000 >>To: "'pli...@li...'" >><pli...@li...> >>From: Rol...@t-... (Rolf Jakob) >>Subject: [Plib-users] exposer and CVS plib >> >>Hello, >> >>My guess is for using exposer to create animations I need the latest CVS >>snapshot ? > > > Dunno - Steve could tell, but he is on vacation. Yes - but I'm back now. I don't recall whether ExPoser worked with 1.5 - I suspect you'll need the version in CVS. We are *seriously* overdue for making a new PLIB release. ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
From: <Rol...@t-...> - 2002-07-07 13:00:04
|
On Sunday 07 July 2002 06:03, ha...@sl... wrote: > If I remember right, ssgLOS in the released version only calls ssgHOT. > I believe this has been corrected in the CVS version of plib, however. Oh, thanks, that would explain the effect. I'll give the CVS version a try. Rolf -- Rolf Jakob at home (rj...@du...) WWW : http://www.franken.de/users/duffy1/rjakob (KDE-Utils and CCS) |
From: <ha...@sl...> - 2002-07-07 04:03:39
|
If I remember right, ssgLOS in the released version only calls ssgHOT. I believe this has been corrected in the CVS version of plib, however. -- Brian On Sun, 7 Jul 2002, Rolf Jakob wrote: >Hello, > >I'm out of ideas. >After successfully checking sphere intersection and height over terrain I need >to check what is in front of the camera. The program moves the camera >position in the scene, so it's a kind of first person shooter. Now I tried to >get the intersections with ssgLOS first using an ident matrix and a vector >pointing into the heading camera angle. I got intersections with the ground >and the sky. Then I set the matrix to the invers camera position relative to >the scene origin, but still the only intersections are ground and sky. I >tried with different vectors, but no success. > >Can anybody explain how to use ssgLOS, given the eye position is the camera >and you want to get a list of all objects just straight in front of you ? > >Many thanks, >Rolf > -- Brian Hayward |