Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-23 Thread Sanat Talmaki
Hi Tom, Thanks for catching that ! You're right that there are no interesctions. But my surface is not a NULL and my x, y coordinates are also valid numbers as I check with console output statements. I found the reason for this behavior. I was using a stream of coordinates data and these ccord

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-23 Thread Tom Pearce
Do you know if you actually have found an intersection? Try adding the statement if(backhoeLocationSegment->containsIntersections()). If you don't have a valid intersection, how are you supposed to get coordinates out of it? Cheers, Tom -- Read this topic online here: http://f

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-23 Thread Sanat Talmaki
Hi Tom, Yes, I should have probbaly tried outputting values to the console a little earlier. It appears there is a bug in VS 2005 while setting a watch on variables in member functions in classes. So I have managed to narrow down my problem to the following lines of code: xPos and yPos are le

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Tom Pearce
Hi Sanat, There's so much there, including functions that I have no idea what they do, that it'll be hard to figure out. There is definitely some unnecessary bits that make it even harder for people who aren't you to figure out what is going on - for example, Code: backhoeGroundPosition = ba

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Sanat Talmaki
Hi Nick, I followed your advice and set up an update callback. But I still can't seem to get rid of the problem that I was facing (i.e. positions getting set to (0,0,0) during callback traversal. I thought it might help if I attach the code for my callback functions instead of copying it here.

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Sanat Talmaki
Hi Robert, I will definitely take a look at the osganimate example. But this is a question I asked in the post above: If I declare a PAT node in my main(), is the only way to access and modify it through update callbacks ? The reason why I'm asking this is that tough I'm passing the PAT node b

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Sanat Talmaki
Hi Nick, I already have 1 update callback that sets the node at the right altitude in the scene given the current position: Just to go over it again, the problem I'm getting is that the value of my PAT is reset to 0 when I call my function setBackhoe(). Is this because my PAT node which was de

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Robert Osfield
Hi Sanat, Have a look at the osganimation example. FYI, Viewer::frame() calls updateTraversal() for you, so you don't need to call it yourself. Robert. On Thu, Jul 22, 2010 at 11:41 AM, Sanat Talmaki wrote: > Hi, > > I am trying to set new values for the position of my PAT node for every run

Re: [osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Trajce (Nick) Nikolov
probably if you post the whole code someone might help you better. My advice is to use the updateCallback of the PAT node - you make sure then you are working on the right node. -Nick On Thu, Jul 22, 2010 at 2:41 PM, Sanat Talmaki wrote: > Hi, > > I am trying to set new values for the position

[osg-users] How to set new PAT position for every traversal run ?

2010-07-22 Thread Sanat Talmaki
Hi, I am trying to set new values for the position of my PAT node for every run of while(!viewer.done()) Code: while( !viewer.done() ) { osg::Vec3d positionVector; // fire off the cull and draw traversals of the scene. viewer.frame(); viewer.updateTraversal(); receiveSignal(