[osg-users] Rotating a vector by a quat

2010-06-29 Thread John Galt
Hi,

I am looking for an easy way to rotate a vec3d by a quat(roll, pitch, yaw). So 
if my vector is defined by (x,y,z) how do I figure out what the resultant of a 
spatial rotation of (roll, pitch, yaw) would be? I have calculated the final 
position of the vector using math but is there any other, more simpler way to 
do it in osg?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29490#29490





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Extracting Node Names from NodePath

2010-06-23 Thread John Galt
Hi,

I have my scene set up as follows:

osg::Node* node1;
osg::Node* node2;
osg::Node* node3;

I have loaded node1, node2 and node3 using readNodeFromFile function.

Then I have my nodes attached to my root as follows: 

root-addChild(PAT1);
PAT1-addChild(node1);
root-addChild(PAT2);
PAT1-addChild(node2);
root-addChild(PAT3);
PAT1-addChild(node3);

Then I got a HitList and extracted Hits out of it. For each particular hit, I 
have extracted the NodePath. What exactly does the NodePath store? How do I 
extract the names of the Nodes that contain the geometry i.e., how do I use the 
NodePath to return the bottom most (leaf node?) node (node1, node2 or node3) in 
my scene graph?



Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29291#29291





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] HitLists

2010-06-23 Thread John Galt
Hi,

Thanks for the help guys. It worked. 

Alberto, I considered using IntersectionVisitor at first but found tutorials 
and examples that use IntersectVisitor so I decided to stick with it.

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29292#29292





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Extracting Node Names from NodePath

2010-06-23 Thread John Galt
Hi,

I did the same thing you suggest but it doesn't work for me.

I used node1-setName(Specific Name); for all the 3 nodes and I am looking 
for the specific name to be returned.

However, all I get is empty strings. 
My node1 = readFromFile(dumptruckosg);
node2 = readFromFile(lz.osg);
node3 = readFromFile(MyOwnAC3dModel.ac);


The code returns only dumptruck.osg as the NodeName when I intersect with 
dumptruck.osg but it returns an empty string when I intersect with lz.osg and 
myownac3dmodel.ac. I am positive that the intersections are occuring because 
the intersection coordinates are perfectly coming through.

However, I am unable to get the Specific Name I assigned for the nodes.




Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29312#29312





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] HitLists

2010-06-22 Thread John Galt
Hi,

If my HitList contains multiple hits, how do I extract all of them starting 
from the first to the last?

I can extract the first and the last hits using HitList.front() and 
HitList.back() but I am having trouble with extracting the other hits in 
between them.


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29242#29242





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Rotating a vector

2010-06-09 Thread John Galt
Hi,

How do I rotate a vector by certain Roll, Pitch, Yaw angles?

Let us say I have a vector osg::Vec3d vector = new osg::Vec3d(10,10,5); 

How do I rotate this?


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28759#28759





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to perform a linesegmnt intersection technique?

2010-05-26 Thread John Galt
Hi,

Can anyone show a simple example of how to perform an intersection technique?

I am looking for these specific things:

1) How to pass a osgUtil::LineSegmentIntersector to a osgUtil:Intersector?

2) How to pass a osgUtil::Intersector to an IntersectionVisitor and return the 
name of the Node/Geode it intersects?

I have looked at the documentation but I am having trouble in understanding the 
implementation. Can anyone elaborate how to implement the intersections?


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28262#28262





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Collision Detection

2010-05-06 Thread John Galt
Hi,

I am trying to implement a code that detects collision between a PAT Node with 
the geometry of a pyramid and multiple other fixed Nodes that are loaded with 
ac3d models.

How do you determine which node (if any) falls within the geometry of the PAT 
Node of the pyramid? 

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27626#27626





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Collision Detection

2010-05-06 Thread John Galt
Hi Paul,

I only plan on detecting intersections between a PATNode and other Nodes. 

I do not intend to write code for a reaction to a collision, I want the 
intersection to happen and only want to know which objects are intersecting. 

Do you suggest I still use osgbullet for that?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27633#27633





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Collision Detection

2010-05-06 Thread John Galt
Hi,

Is there any example that demonstrates how to use osgUtil for doing this?

I caught some of the ideas of osgUtil in the quick start guide (pg 103) but 
lost my way at 


 osgUtil::PolytopeIntersector* picker =
 new osgUtil::PolytopeIntersector(
 osgUtil::Intersector::PROJECTION,
 x-w, y-h, x+w, y+h );
 


What exactly does the Intersector::PROJECTION try to achieve? How do I get the 
osgUtil functions to relate to the pyramid geometry?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27639#27639





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera Behavior

2010-04-06 Thread John Galt
Hi,

Here's the video of what is happening with my camera: 
http://www.youtube.com/watch?v=_7tfZuRgyYE

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26494#26494





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera Behavior

2010-04-06 Thread John Galt

Alberto Luaces wrote:
 John Galt writes:
 
 
  Here's the video of what is happening with my camera: 
  http://www.youtube.com/watch?v=_7tfZuRgyYE
  
 
 Difficult to say... The camera seems to be moving properly, since the
 doll is being rotated accordingly. The white and blue colors could be a
 clipping issue with a plane at Z=0. Try to raise the camera (eyeZ  0)
 in order to see if it changes anything.
 
 --
 Alberto  
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


The camera is supposed to be fixed at (0,0,2). The camera's view frustum is 
supposed to be aligned as the frustum shown in the right view window.

In the left window, the camera is supposed to be fixed at a point and only 
rotate about Z axis. How ever it seems to me like the camera while rotating 
about the Zaxis is also revolving in an orbit about the point (0,0,2).

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26497#26497





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Camera Behavior

2010-04-05 Thread John Galt

Alberto Luaces wrote:
 John Galt writes:
 
 
  Hi,
  
  I have setup my view as
  
  view-getCamera()-setViewMatrixAsLookAt(eye, center, up);
  
  eye, center and up are osg::Vec3 elements.
  
  I have my eye and up as constant. When I change my center vector, the 
  Camera's position is changing!
  
  Can anyone explain why? Shouldn't the camera's position (X,Y,Z) be fixed if 
  the eye vector is constant?
  
 
 John,
 
 eye and center are not vectors but points. When you use them in
 setViewMatrixAsLookAt, you actually mean from eye to center.
 
 --
 Alberto
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


Hi Alberto,

Even if that is the case, when my eye is fixed and center is changing, should I 
see the view as a camera that is rotating about a fixed point? Why is it that I 
am seeing the camera rotate about a moving point?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26447#26447





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bizzare setViewMatrixAsLookAt behavior !!

2010-04-05 Thread John Galt
Hi,

What is happening is that the eye instead of being fixed at say (X1,Y1,Z1) is 
revolving around that point in a small circle while pointing to the correct 
center!

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26472#26472





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Camera Behavior

2010-04-04 Thread John Galt
Hi,

I have setup my view as

view-getCamera()-setViewMatrixAsLookAt(eye, center, up);

eye, center and up are osg::Vec3 elements.

I have my eye and up as constant. When I change my center vector, the Camera's 
position is changing!

Can anyone explain why? Shouldn't the camera's position (X,Y,Z) be fixed if the 
eye vector is constant?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26435#26435





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Flickering in camera views with multiple cameras

2010-04-02 Thread John Galt
Hi,

The window frames did the trick! 

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26402#26402





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Bizzare setViewMatrixAsLookAt behavior !!

2010-04-02 Thread John Galt
Hi,

I am using the setViewMatrixAsLookAt to set up my camera.

I have set up my camera as follows:


 viewer.getCamera()-setViewMatrixAsLookAt(osg::Vec3(XCoordinate,YCoordinate,ZCoordinate),
  osg::Vec3(XCoordinate - 
 10*cos(osg::DegreesToRadians(Pitch))*sin(osg::DegreesToRadians(Yaw)),YCoordinate
  + 
 10*cos(osg::DegreesToRadians(Pitch))*cos(osg::DegreesToRadians(Yaw)),ZCoordinate
  + 10*sin(osg::DegreesToRadians(Pitch))), osg::Vec3(0.0, 0.0, 1.0));


My XCoordinate, YCoordinate and ZCoordinate values remain constant over the 
whole code and the values of Roll, Pitch, Yaw change and yet when the Roll, 
Pitch, Yaw are changed, the position of the camera's eye is being changed. Even 
though I defined the eye's position as 
osg::Vec3(XCoordinate,YCoordinate,ZCoordinate). Seems a bit odd for me to 
understand why this is happening.

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26403#26403





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bizzare setViewMatrixAsLookAt behavior !!

2010-04-02 Thread John Galt

Redbeard wrote:
 Hi,
 
 I am using the setViewMatrixAsLookAt to set up my camera.
 
 I have set up my camera as follows:
 
 
  viewer.getCamera()-setViewMatrixAsLookAt(osg::Vec3(XCoordinate,YCoordinate,ZCoordinate),
   osg::Vec3(XCoordinate - 
  10*cos(osg::DegreesToRadians(Pitch))*sin(osg::DegreesToRadians(Yaw)),YCoordinate
   + 
  10*cos(osg::DegreesToRadians(Pitch))*cos(osg::DegreesToRadians(Yaw)),ZCoordinate
   + 10*sin(osg::DegreesToRadians(Pitch))), osg::Vec3(0.0, 0.0, 1.0));
 
 
 My XCoordinate, YCoordinate and ZCoordinate values remain constant over the 
 whole code and the values of Roll, Pitch, Yaw change and yet when the Roll, 
 Pitch, Yaw are changed, the position of the camera's eye is being changed. 
 Even though I defined the eye's position as 
 osg::Vec3(XCoordinate,YCoordinate,ZCoordinate). Seems a bit odd for me to 
 understand why this is happening.
 
 Also, if I know the camera's location(X,Y,Z) and orientation (Roll, Pitch, 
 Yaw), is there any easy function to set the view of the camera instead of 
 doing vector math on paper and setting it up using (eye, dir, up)?
 
 
 Thank you!
 
 Cheers,
 John


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26404#26404





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Flickering in camera views with multiple cameras

2010-04-01 Thread John Galt
Hi,

I am using two views with viewports in my composite viewer. While running the 
code I see the two views but they seem to be flickering. 

Does anyone know what's the reason behind it and how I can fix it so that I can 
get a smooth feed for both views at the same time?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26374#26374





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two cameras for the same scene

2010-03-31 Thread John Galt
Hi,

I took a look at the example. I couldn't figure out how to see both views at 
the same time on the screen.

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26320#26320





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two cameras for the same scene

2010-03-31 Thread John Galt
Hi,

My scene graph has a pyramidNode and a pyramidTwoXForm (PAT Node) attached to 
the root.

My composite viewer is defined as follows:


   osgViewer::View* viewOne = new osgViewer::View;
   viewOne-setName(First View);
   viewOne-setSceneData( root );
   // viewOne-setUpViewAcrossAllScreens();
   viewOne-setUpViewOnSingleScreen(1);
   viewOne-getCamera()-setViewport(new osg::Viewport(0,0,500,500));
   viewOne-getCamera()-setProjectionMatrixAsPerspective(45, 1, 2, 10);
   // viewOne-setUpViewAcrossAllScreens();
   viewOne-setCameraManipulator( new osgGA::TrackballManipulator);
   // viewOne-setCameraManipulator(followPyramidTwoXForm);
   compositeViewer.addView(viewOne);
 
   osgViewer::View* viewTwo = new osgViewer::View;
   viewTwo-setName(Second View);
   viewTwo-setSceneData( root );
   viewTwo-setUpViewOnSingleScreen(0);
   viewTwo-getCamera()-setViewport(new osg::Viewport(520, 0, 500, 500));
   viewTwo-getCamera()-setProjectionMatrixAsPerspective(45, 1, 2, 10);
   viewTwo-setCameraManipulator( new osgGA::TrackballManipulator );
   compositeViewer.addView(viewTwo);


 I want to have the viewTwo camera follow the pyramidTwoXForm (PAT). How do I 
set it to do the required? 

Please help me, I am unable to figure this out for a while now.

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26335#26335





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Two cameras for the same scene

2010-03-31 Thread John Galt

mgb_osg wrote:
 I don't know how current it is, i've never had to do this, but the tutorial 
 at 
 http://www.openscenegraph.org/documentation/NPSTutorials/index.html
 describes multiple cameras following a node (scroll down to the pictures of 
 tanks)
 
 
 Cheers,
 Martin


Unfortunately, that code is obsolete AFAIK.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26339#26339





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Two cameras for the same scene

2010-03-30 Thread John Galt
Hi,

I have a moving object as a node in my scenegraph. I want a first person and a 
3rd person points of view. How do I do it? The tutorial uses Producer class 
which I believe is obsolete. 

What is the substitute for Producer::CameraConfig*  ? Is there an example code 
I can refer to?



Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26285#26285





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] 3d Model Editing

2010-03-27 Thread John Galt
Hi,

I need separate models of a man's body and head. Can you suggest where I can 
find them? Any of these file formats will do: 3dc, 3ds, flt, geo, iv, ive, lwo, 
md2, obj, osg.

Also, does anyone know how to edit an osg model. For instance in the example 
cow.osg, how do I edit it so that only its head is present and the body is 
deleted?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26224#26224





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Accessing Child Nodes

2010-03-20 Thread John Galt
Hi,

I'm trying to access a child node to perform Position Attitude Transformations 
but I am unable to figure out how to do so.

My createModel(overlay, technique) is defined as follows:


 
 
 osg::Group* root = new osg::Group;
 
 // float baseHeight = center.z()-radius*0.5;
   float baseHeight = 0;
 osg::Node* baseModel = createBase(osg::Vec3(center.x(), center.y(), 
 baseHeight),radius);
 osg::Node* movingModel = createFrustumGeode(2,4,45,45);
 
 if (overlay)
 {
 osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode(technique);
 overlayNode-setContinuousUpdate(true);
 overlayNode-setOverlaySubgraph(movingModel);
 overlayNode-setOverlayBaseHeight(baseHeight-0.01);
 overlayNode-addChild(baseModel);
 root-addChild(overlayNode);
 }
 else
 {
 
 root-addChild(baseModel);
 }
 
 root-addChild(movingModel);
 
 return root;
 }
 
 



My main function has this code:


  
 
 
 // initialize the viewer.
 osgViewer::Viewer viewer;
 
 // load the nodes from the commandline arguments.
 osg::Node* model = createModel(overlay, technique);
 if (!model)
 {
 return 1;
 }


Now at this point in my main function, I want to access the child node of model 
(say the movingModel node) and perform a position attitude transformation on 
it.

How do I access it and perform the transformation? Any suggestions would be 
welcomed by this newbie.


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25923#25923





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] WRL Plugin needed

2010-03-14 Thread John Galt
Hi,

The link doesn't seem to work. 

I would appreciate it if anyone is willing to share binaries of the VRML Plugin 
for Visual Studio 2008.

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25631#25631





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] WRL Plugin needed

2010-03-13 Thread John Galt
Hi,

I have a wrl file I would like to use as a 3D model. I found lots of sites 
telling me that there is a plugin enabling me to read those, but I couldn't 
find the .dll
file that is actually the plugin.

Can anyone please send me the link to download the plugin?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25624#25624





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rotating a Pyramid about its peak

2010-03-10 Thread John Galt
Hi,

How do I translate the origin to the peak?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25474#25474





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Rotating a Pyramid about its peak

2010-03-09 Thread John Galt
Hi,

I am trying to move a pyramid in the following manner. 

(X,Y,Z,Roll,Pitch,Yaw) - read from a txt file.
Move the pyramid by (X,Y,Z) and then rotate it about its peak by (Roll, Pitch, 
Yaw)

Here's the code I made till now:


  osg::AnimationPath* animationPath = 
 createAnimationPath(autoPath2.txt,0.1);
 
 {...
 Defined the Pyramid
 ...
 }
 
  const osg::BoundingSphere bs = pyramidGeode-getBound();
 
  float size = radius/bs.radius()*0.3f;
  osg::MatrixTransform* positioned = new osg::MatrixTransform;
  positioned-setDataVariance(osg::Object::STATIC);
  positioned-setMatrix(osg::Matrix::translate(-bs.center())*
   osg::Matrix::scale(size,size,size)*
   
 osg::Matrix::rotate(osg::inDegrees(-90.0f),0.0f,0.0f,1.0f));
 
  positioned-addChild(pyramidGeode);
 
  osg::PositionAttitudeTransform* xform = new 
 osg::PositionAttitudeTransform;
  xform-setUpdateCallback(new 
 osg::AnimationPathCallback(animationPath,0.0,1.0));
  xform-addChild(positioned);
 
  model-addChild(xform);


My animation is defined as follows:


 osg::AnimationPath* createAnimationPath(std::string filename,double deltatime)
 {
   std::ifstream infile;
   infile.open(filename.c_str(),std::ios::in);
   double time=0.0f;
 
   osg::AnimationPath* animationPath = new osg::AnimationPath;
   animationPath-setLoopMode(osg::AnimationPath::LOOP);
 
   
 
   while(infile.is_open()  !infile.eof())
   {
 
double x,y,z,r,p,ya;
infile  x  y  z r pya;
osg::Vec3 position(x,y,z);
osg::Quat rotation;
 
rotation.makeRotate( osg::DegreesToRadians(r), osg::Vec3(-1,0,0), 
osg::DegreesToRadians(p), osg::Vec3(0,-1,0) , 
osg::DegreesToRadians(ya), osg::Vec3(0,0,1) );
 
   
 animationPath-insert(time,osg::AnimationPath::ControlPoint(position,rotation));
 time += deltatime;
   }
 
   infile.close();
   
   return animationPath;
  
 }



But what this does is move the pyramid by X,Y,Z and rotate it by Roll,Pitch,Yaw 
about the ORIGIN!

I want to rotate it around its peak and not the origin. Can you suggest any 
modifications? 


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25432#25432





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Collision Detection

2010-03-05 Thread John Galt
Hi,

I have a noob question.

Say I have a pyramid defined by points 0,1,2,3,4. And say I have another cube 
determined by points 5,6,7,8,9,10,11,12.

How do I detect whether the entire cube falls inside the pyramid or not?

What if the cube is very small and can be defined by a single point 13. Can I 
find out if the point 13 falls within the pyramid with a simple osg command?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25269#25269





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Moving Pyramid in Real Time

2010-03-04 Thread John Galt
Hi,

I want to move a pyramid based on a defined path (X,Y,Z) of its peak and the 
Roll, Pitch, Yaw.

I have the details of X, Y, Z, Roll, Pitch, Yaw coming from another c++ code 
and is updated in real time. 

Does anyone have any suggestions as to how to go about moving it in OSG without 
the obvious frame change algorithm?


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25220#25220





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application

2010-02-28 Thread John Galt
Hi,

That worked brilliantly! 

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24986#24986





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [forum] Please ignore this message...

2010-02-25 Thread John Galt
Hi,

Ignored


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24894#24894





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Error Code: 0xC0150002 : The application failed to initialize properly. Click on Ok to terminate the application

2010-02-25 Thread John Galt
Hi,

I installed the binaries. osg works fine from the command prompt. I liked VS08 
to osg using the Dwight Design tutorial: 

I'm trying to compile this example: osganimate.cpp from the osg site.

When I try to build it it gives the following message:



1-- Build started: Project: OSGTemp, Configuration: Debug Win32 --
1Compiling...
1OSGMain.cpp
1Compiling manifest to resources...
1Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1Copyright (C) Microsoft Corporation.  All rights reserved.
1Linking...
1LINK : C:\Users\Manu\Documents\Visual Studio 
2008\Projects\OSGTemp\Debug\OSGTemp.exe not found or not built by the last 
incremental link; performing full link
1Embedding manifest...
1Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1Copyright (C) Microsoft Corporation.  All rights reserved.
1Build log was saved at file://c:\Users\Manu\Documents\Visual Studio 
2008\Projects\OSGTemp\OSGTemp\Debug\BuildLog.htm
1OSGTemp - 0 error(s), 0 warning(s)
== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==


and when I run it I get the dreaded error code!

Also, I'm in a weird situation where I'm having TWO Debug folders!

One's address is: Visual Studio 2008/Projects/OSGTemp/Debug

The Other Debug Folder is being created in: Visual Studio 
2008/Projects/OSGTemp/OSGTemp/Debug

Do you have any suggestions for me to correct this error? 


Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24895#24895





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Trouble Accessing Open Scene Graph Website/ Tutorial

2010-01-30 Thread John Galt
Hi,

The website doesn't seem to load. Is it just my system or does that seem to be 
the case for everyone?

Also when I go to the tutorial page and try to download the OpenSceneGraph.zip 
file it redirects me to Joe Sullivan's homepage! Does anyone know what's going 
on? 

Also, is it possible to run open scene graph on Visual Studio 2008 or do i have 
to run it in previous versions?


... 

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=23449#23449





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org