[osg-users] NodeTrackerManipulator how to

2009-05-16 Thread Rabbi Robinson
Hi, I am using NodeTrackerManipulator in my application to follow a node. I would like NodeTrackerManipulator to be fixed in the followed node coordinate. e.g. the camera always follow a character, but always some distance behind it and looking forward in the character's coordinate. Can someone

[osg-users] multiple inheritance destructor

2009-05-17 Thread Rabbi Robinson
Hi, I am creating a new class that inherits from "Group" and "NodeCallback", it works find except for the deconstruct which always cause a segmentation fault. Can someone show me proper ways to destruct a class like this? Thank you! Cheers, Rabbi -- Read this topic online her

Re: [osg-users] multiple inheritance destructor

2009-05-18 Thread Rabbi Robinson
Hi, Thanks Robert. What I wanted to do is create a node that can automatically update itself. I am integrating its with ode so the position and orientation information is from ode. As for multiple inheritance, I thought that was one of the strength of c++ for code reusability. The problem can b

[osg-users] texture and material of geode

2009-05-23 Thread Rabbi Robinson
Hi, I run into problem when I assigned both material and texture to a geode. If I have just either material(ambient, diffuse, etc) or texture, it worked fine. However, if I have both of them, the geo looks black. Is there thing I need to do to blend the texture and the material? Thank you! Ch

Re: [osg-users] Attack the PrimitiveSet

2009-05-27 Thread Rabbi Robinson
Hi, What exactly do you mean "attacking", are you trying to remove primitive from primitive sets. Indices are deprecated and they are not encouraged to be used anymore. The "dirty" way is the "classical" way. Thank you! Cheers, Rabbi -- Read this topic online here: http://foru

[osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi, I wonder osg::ref_ptr<> is used anymore for automatic memory management. I remember sometime ago I got an error from mishandling multiple inheritance, the error printed on the screen was that the reference count of a node is some non-sense number when the destructor of the node executes (so

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi, Thanks, that explains it. Correct me if I am wrong. So to use it, just create osg::ref_ptr<> and use it as regular pointer and the memory will be managed by osg::ref_ptr<>. In a simple case, I careate Node* node = osg::ref_ptr and, call void* ptr = node. I suppose the reference count in no

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi, Sorry, 404 Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13110#13110 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listi

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-29 Thread Rabbi Robinson
Hi, Thanks for the replies. They really clarified a lot. Looks like for small pointer, it's all or none deal, e.g. it's best to use them every time a reference to the pointed object is needed. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegrap

Re: [osg-users] osg::ref_ptr<> used anymore

2009-06-01 Thread Rabbi Robinson
Hi, Ok, I started this thread, so I claim to have the right for the last words. I have used boost before, it looks like a pretty well maintained library. I used it because I was working on my coworker's code and in our case, he only used the file separator ("\" vs "/") from boost. For that it p

[osg-users] manual delete object

2009-06-01 Thread Rabbi Robinson
Hi, When I tried Node* node = new Node; delete node; there is a compiler error saying destructor protected. How can I delete node that I am sure I no longer use. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13275#132

Re: [osg-users] manual delete object

2009-06-01 Thread Rabbi Robinson
Hi, Thanks, if later I reference the node from a group, will the reference count be increased for the node? { osg::ref_ptr node = new Node; osg::ref_ptr group = new Group; group->addChild(node); } The reference count of node should be one outside the scope. Is it right that somehow group->addCh

Re: [osg-users] Character animation

2009-06-02 Thread Rabbi Robinson
Hi, We are doing animation export from maya 2008. So a guy in our group get the basic keyframe animation working. We still need to get the whole skeleton and skin animation going as soon as possible. I post what we find out here. It looks like there is already skeleton/skin animation in osg, a

Re: [osg-users] manual delete object

2009-06-02 Thread Rabbi Robinson
Hi, Thanks, your hint already gave it all out. I was wondering if user need to keep track of the reference to Node assigned to Group. As you said, group use smart pointer internally so group->addChild(new Node) will delete the node created once group is gone. Thank you! Cheers, Rabbi ---

[osg-users] transparent object sorting and back face culling

2009-06-02 Thread Rabbi Robinson
Hi, There are simple questions: What do I need to do to make sure transparent object show up properly? How do I cull the back face of polygon? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13372#13372

Re: [osg-users] transparent object sorting and back face culling

2009-06-03 Thread Rabbi Robinson
Hi, Thanks for the help, when I tried ss->setMode(GL_BLEND, StateAttribute::ON); ss->setRenderingHint(StateSet::TRANSPARENT_BIN); nothing shows up. The cull face works tho Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?

Re: [osg-users] transparent object sorting and back face culling

2009-06-03 Thread Rabbi Robinson
Hi, The alpha value is about .5, It works fine except for the renderinghint statement. ss->setRenderingHint(StateSet::TRANSPARENT_BIN); If I comment it out, I can see the transparent object but they are not sorted properly. So there must be some problem with the depth sorting. Thank you!

[osg-users] maxium children count

2009-06-06 Thread Rabbi Robinson
Hi, I am doing a PDB (protein data base) file importer. The number of atoms in a typical database is about 4000 to 6000, I organize them in to groups with positionattitudetransform. I noticed if the number of atoms exceeds certain number, the program crashes in run time. So, is there a max numb

Re: [osg-users] maxium children count

2009-06-06 Thread Rabbi Robinson
Hi, Oh, the problem was somewhere else. Thanks for the debugging tip tho. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13646#13646 ___ osg-users mailing list osg-users@li

[osg-users] animation doc/tutorial

2009-06-06 Thread Rabbi Robinson
Hi, I recently started looking at the animation part of osg. I have read some examples and wonder if there is tutorial or formal documentation for it. For example, I would like to replace the linear interpolation in the example osganimationsolid with cubic bezier interpolation. It doesn't really

Re: [osg-users] animation doc/tutorial

2009-06-07 Thread Rabbi Robinson
Hi, Thanks, I guess I will need to learn it the hard way. I would prefer that whoever implemented the animation would spell out most of the details of it, like a tutorials for the basic osg features. It's just sometimes frustrating to copy and paste the sample code without fully understand it a

[osg-users] setDataVariance(osg::Object::DYNAMIC);

2009-06-16 Thread Rabbi Robinson
Hi, Hi, I wonder when I should use setDataVariance(osg::Object::DYNAMIC); Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14046#14046 ___ osg-users mailing list osg-users@li

[osg-users] light setup

2009-06-25 Thread Rabbi Robinson
Hi, I have some basic questions about the light setup in osg. I looked at the example osglight. It seems there is a osg::Light class and there is a osg::LightSource. One is state attribute and another is a group. Can someone explain practically how a light and lightsouce work together. For exam

[osg-users] osgShadow example

2009-06-26 Thread Rabbi Robinson
Hi, I tried osgShadow example and it just turned out to be black, unlit geometries. Much less the shadow. I have run the exmaple on Mac, Windows and Linux and all the same. Anyone else has the same problems? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum

[osg-users] movie with sound

2009-06-26 Thread Rabbi Robinson
Hi, We are developing a game with movies (mpeg) and would like to play them as cut scenes. I see there is a osgmovie example there and we would like to play sound in the movie using a sound library call FMOD. The example uses quicktime plugin and the plugin in calls quicktime routine. My ques

Re: [osg-users] osgShadow example

2009-06-26 Thread Rabbi Robinson
Hi, Thanks, never tried with those arguments. My video cards are mostly nvidia Quadro something. We are developing this game so it can run on most reasonably recent graphics cards. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtop

[osg-users] maya plugin, anyone interested?

2009-06-26 Thread Rabbi Robinson
Hi, We are currently developing a plugin for Maya. So far it supports basic geometry, texture, bump map, lod, instancing and animation, including keyframe animation and character/skeleton animation. Particle system will be added soon. This implementation is publicly funded so it doesn't have p

Re: [osg-users] maya plugin, anyone interested?

2009-06-26 Thread Rabbi Robinson
Hi, I should probably have used .ive file. I didn't consider such possibility ver carefully when I started. There is an other fellow doing exactly that for OpenSG, except for OpenSG use XML file format which I think is really cumbersome. One reason for the intermediate binary format is that

Re: [osg-users] maya plugin, anyone interested?

2009-06-27 Thread Rabbi Robinson
Hi, Ok, I will give it a try and see how it works. Can .osg contain callbacks? They are needed in animation. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14615#14615 ___

[osg-users] 64 bit 3rd party Dependencies

2009-06-27 Thread Rabbi Robinson
Hi, Is there a 64bit 3rd party dependencies somewhere I can download? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14616#14616 ___ osg-users mailing list osg-users@lists.

[osg-users] get current accumulated transform

2009-06-29 Thread Rabbi Robinson
Hi, How do I get current accumulated transform in a nodeupdatecallback? Specifically virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) What does NodeVisitior->apply(something) mean? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegr

[osg-users] quaternion to euler

2009-06-29 Thread Rabbi Robinson
Hi, The animation supports euler but not quaternion. Is there any easy way to convert quaternion to euler? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14664#14664 ___ o

Re: [osg-users] quaternion to euler

2009-06-30 Thread Rabbi Robinson
Hi, Yes, I am using that. I will give it a try. Strangely there is "euler" in the animation but not more useful "quaternion". Can you show me how to add it? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14721#14721

[osg-users] softshadowmap and glsl shader

2009-06-30 Thread Rabbi Robinson
Hi, I am writing my own shader (glsl) for rendering. Can anyone show me how to draw shadow in the scene? What is in the texture unit used by softshadow map. Is that depth, grey scale color ? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.o

Re: [osg-users] softshadowmap and glsl shader

2009-06-30 Thread Rabbi Robinson
Hi, Thanks, I see there is only fragment shader, is vertex shader somewhere else? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14728#14728 ___ osg-users mailing list osg-

[osg-users] how to set uniform is shaders by vertex

2009-07-01 Thread Rabbi Robinson
Hi, Is there any way I can set the uniforms by vertex? I know uniforms are in stateset. There are some attribute for vertex I need to set in shaders for each vertex. How can I do it? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewt

Re: [osg-users] maya plugin, anyone interested?

2009-07-21 Thread Rabbi Robinson
Hi, Hi, I have prepared a tar ball for this exporter. Its located at http://vrac.iastate.edu/~freeman/Rocky_maya.tar There is some detailed documentations. But basically you will need to use CMake to build it. All testers are welcome and please post your comments here on OSG forum. Thank you

[osg-users] offscreen rendering

2009-08-10 Thread Rabbi Robinson
Hi, Can someone show me how to do offscreen rendering? What I have so far is a shader that render the texture on the screen after processing. I would like to render it offscreen and save it as a texture map. Any reference will also be appreciated Thank you! Cheers, Rabbi -- Rea

Re: [osg-users] offscreen rendering

2009-08-10 Thread Rabbi Robinson
Hi, What is the example called? I see there are some examples for prerendering. That's not what I need. In my case, I only need to do off screen rendering once at the beginning of the application for all. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.ope

Re: [osg-users] offscreen rendering

2009-08-10 Thread Rabbi Robinson
Hi, Here is what I got so far. osgViewer::Viewer viewer; //graphics context osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x = 0; traits->y = 0; traits->width = image->s(); traits->height = image->t(); traits->red = 8; traits->green = 8;

[osg-users] viewer.frame() rendering not complete

2009-08-11 Thread Rabbi Robinson
Hi, I have a code that creates a temporary viewer and uses it to render one frame and copy from the color buffer to an image. When I call viewer.frame() the rendered image is only half done. Is there anyone to tell the viewer to complete a frame, save it and close itself? Thank you! Cheers, R

[osg-users] viewer invisible?

2009-08-11 Thread Rabbi Robinson
Hi, How can I set a viewer invisible for RTT? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16084#16084 ___ osg-users mailing list osg-users@lists.openscenegraph.org http

Re: [osg-users] viewer.frame() rendering not complete

2009-08-11 Thread Rabbi Robinson
Hi, I save it in a file. The problem is with frame(). If I call viewer.run() and hit Esc to quit the viewer the image is complete. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16092#16092 _

[osg-users] runtime error

2009-08-11 Thread Rabbi Robinson
Hi, I am getting a lot of "Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)" at run time. Can someone tell me how to narrow it down? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16116#16116

[osg-users] RTT getting image crashes

2009-08-12 Thread Rabbi Robinson
Hi, I am trying to create a simple scene and render it to an image. The problem is the image that is attached to the camera is always null. Can some one tell me what is going on? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic

Re: [osg-users] transparent object sorting and back face culling

2009-08-13 Thread Rabbi Robinson
Hi, The transparent blending works fine now. How ever the sorting does seem currect. Sometime the transparent object disappears or not drawn at all. , It view dependent Is there anyway it can be fixed? stateSet->setMode(GL_BLEND, StateAttribute::ON); stateSet->setRenderingHint(StateSet::TRANS

Re: [osg-users] transparent object sorting and back face culling

2009-08-13 Thread Rabbi Robinson
Hi, Is there anyway that I can enforce drawing the objects inside first before drawing the outside membrane? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16203#16203 ___

[osg-users] RTT buffer VS FBO VS FB

2009-08-13 Thread Rabbi Robinson
Hi, For render-to-texture, there are several implementation. At least I know RTT buffer, Frame buffer and Frame buffer object. Can someone explain the difference to me and which one is more portable across different hardware? Thank you! Cheers, Rabbi -- Read this topic online

[osg-users] LOD for stateset

2009-08-13 Thread Rabbi Robinson
Hi, What is the best approach to change stateset based on the distance between the object and the camera? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16205#16205 ___ os

Re: [osg-users] Rotation and scaling problem

2009-08-13 Thread Rabbi Robinson
Hi, Just set the transformation matrix to idenity Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16207#16207 ___ osg-users mailing list osg-users@lists.openscenegraph.org ht

Re: [osg-users] transparent object sorting and back face culling

2009-08-13 Thread Rabbi Robinson
Hi, I see there is a osgUtil::RenderBin, is that what you are refering to? If not, is the class you mentioned going to be released soon? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16208#16208

Re: [osg-users] LOD for stateset

2009-08-13 Thread Rabbi Robinson
Hi, Is there quick way I can get the distance from the camera or I need to save or reference to the position of the camera each frame and use that to compute the distance? Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=1

[osg-users] Image release question

2009-08-13 Thread Rabbi Robinson
Hi, I am trying to create an image out of a memory block: unsigned char * data= new unsigned char[1024]; image->setImage (int s, int t, int r, GLint internalTextureformat, GLenum pixelFormat, GLenum type, unsigned char *data, AllocationMode mode, int packing=1) For Allocation mode, there are

Re: [osg-users] Rotation and scaling problem

2009-08-14 Thread Rabbi Robinson
Hi, Node* ResetNodeMatrices( Node *node) { osg::Group* root = new osg::Group; osg::Matrix matrix; osg::MatrixTransform* transform = new osg::MatrixTransform; matrix.makeIdentity(); transform->setMatrix(matrix); root->addChild(transform); transform->addChild(node); return root->getChild(0); } I

Re: [osg-users] viewer.frame() rendering not complete

2009-08-14 Thread Rabbi Robinson
Hi, I add a camera to the scene that renders the texture I want and set the camera to use pixel buffer. I am trying to do some preprocessing for the texture map beforehand. The viewer is used only to render one frame or two before it deconstructs. The result is random, sometimes the rendered

Re: [osg-users] Image release question

2009-08-14 Thread Rabbi Robinson
Hi, Well, I see the code and the reason why I am posting here is because even I match the allocation type properly, it still crashes. In VC, it complains that there is something wrong the heap. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegrap

Re: [osg-users] Image release question

2009-08-14 Thread Rabbi Robinson
Hi, I compile the code in debug mode. Well, the image is good either on the screen or saved as file, which likely rules out the dimension problems. Its the delete that is causing the problem Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.or

Re: [osg-users] viewer.frame() rendering not complete

2009-08-14 Thread Rabbi Robinson
Hi, I attach the image to the camera and use PRE_RENDER for the camera. I just use the osgDB to write the image to file. I also notice that the chance of getting an image for calling viewer.frame() once is zero. What I do now is calling frame() for 10 times before saving the image. Still, the

[osg-users] data sync between callbacks

2009-08-17 Thread Rabbi Robinson
Hi, I have two callbacks that share some data. One saves the current transformation matrix into the member if it, other one gets it. It looks that the second callback always get the same even the transformation matris is different. I guess it's probably has some thing to do with multi threading

[osg-users] how to set camera perspective lookat

2010-01-13 Thread Rabbi Robinson
Hi, I need to position my camera at certain location and look at another. Can someone tell me how to do that? I have the following code the it does not do what it's supposed to do camera->setProjectionMatrixAsPerspective(45.0, 1.0, 0.5, 1000); camera->setProjectionMatrix(osg::Matrix::lookAt(Vec

[osg-users] locking nodes

2010-01-31 Thread Rabbi Robinson
Hi, I have a multithread application which might update an node (add/remove children etc) at the same time. Is there any locking mechanism for ensuring only one thread is in a critical session at any time. I look at the source code of Group which just use std::vector for children list. As far

Re: [osg-users] locking nodes

2010-02-01 Thread Rabbi Robinson
Hi, Thanks, that helps alot. That kinda explain why in OpenSG you have lock each single update operation. I thought OSG handles that internally, but looks like its going to be more complicated than that. I guess I will try to avoid multithread in this case and just have one single thread respo

[osg-users] CGFX

2010-02-01 Thread Rabbi Robinson
Hi, What is the status on CGFX? Last post on this topic was back in 2008. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23502#23502 ___ osg-users mailing list osg-users@li