Re: [osg-users] Decompose osg::Matrix and apply to osg::PositionAttitudeTransform

2009-10-15 Thread Andrew Thompson
Another slant at this, I've created a transform type to inherit osg::Transform that lets me set by matrix and by position, attitude, scale. Code: class ExtendedTransform : public osg::Transform { public: ExtendedTransform();

[osg-users] Decompose osg::Matrix and apply to osg::PositionAttitudeTransform

2009-10-15 Thread Andrew Thompson
Hi there, This might be a load of rubbish and not possible mathematically, but I'm trying to decompose a matrix and apply it to an osg::PositionAttitudeTransform in order to set the PAT by matrix. The reasoning behind this is I am using PAT to give a human friendly position, rotation, scale

[osg-users] Screenshot of Current view at specific size using ScreenCaptureHandler

2009-10-12 Thread Andrew Thompson
Hi there, I'm using the ScreenCaptureHandler to capture a screenshot of the current view and save it to disk. I would ideally like to save at a specific resolution, say 1280x1024, however the handler is saving the image at the current size of the viewer. My application is a CAD style applica

[osg-users] Clarification on use of Manipulators in CAD-Style app

2009-09-25 Thread Andrew Thompson
Hi there, I am developing a CAD-Style application and am interested in using osgManipulator to provide picking, moving, rotating and scaling of objects. I just have a couple of questions with regard to the use of manipulators, and hope some of you can take the time to answer them for me. Fir

Re: [osg-users] Excluding a Geode from Small Feature Culling

2009-09-08 Thread Andrew Thompson
Hi there, and thanks for your response, well I am using small feature culling in my application to improve performance. Its a CAD-style app and I have hundreds of thousands of Geodes on the screen at any one time. Many are really small so I am throttling small-feature culling to maintain a dec

[osg-users] Excluding a Geode from Small Feature Culling

2009-09-08 Thread Andrew Thompson
Hi there, a quick question for you guys, is it possible for a Geode to be excluded from SMALL_FEATURE_CULLING? Thank you! Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17150#17150 ___ os

[osg-users] Loading an osg::Image using setImage

2009-08-20 Thread Andrew Thompson
Hi there, I am trying to load an osg::Image using the setImage method - inparticular I am copying a Managed bitmap (System.Drawing.Bitmap) to the osg::Image to use it as a texture map. As you can see I'm having a few problems. Here's the osg::Image texture mapped onto a quad when I load it i

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

2009-08-18 Thread Andrew Thompson
Hi Paul, Cheers for your response, ok I missed that first time around, so it is possible, that's good, just not 100% sure on how you implemented it. One special case is in my system the transparent box is sort of a zone that the camera may move inside or outside. I need it to render properly

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

2009-08-17 Thread Andrew Thompson
Hi there A quick related question for you guys, does OSG do the transparency bin sorting per Geode or per primitive? I have a Geode with multiple transparent primitives in it, however one is a box with 4 sides created using QUAD_STRIP and top/bottom created using POLYGON and as such as not com

Re: [osg-users] obtaining vertices

2009-08-13 Thread Andrew Thompson
Hi Brett Could you elaborate on how you did it? I am facing a similar problem. Thank you! Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16183#16183 ___ osg-users mailing list osg-u

Re: [osg-users] Using OSGShadow to compute and return a shadow map in a texture or bitmap

2009-08-11 Thread Andrew Thompson
I realise this is a bit of a complicated question, but does anyone have any ideas if this is possible with OSG? Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16099#16099 ___ osg-use

Re: [osg-users] Get the top coordonates from screen of an object

2009-08-11 Thread Andrew Thompson
Hi Adrien, I'm afraid I don't have an answer for you, but I am about to attempt to do the same thing, so would be interested to hear the answer. Any ideas OSG community? Thanks, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16097#1609

Re: [osg-users] Infinite Grid in OSG

2009-08-10 Thread Andrew Thompson
Hi, Well, that was simple Code: virtual osg::BoundingBox computeBound() const { osg::BoundingBox bbox; // Compute the min/max X and Y values for the grid float miny = (m_posY-(m_vHeight/2*m_zoom)); float maxy = (m_posY+(m_vHeight/2*m_zoom)); float minx = (m_posX-(m_vWidth/2*m_zo

Re: [osg-users] Infinite Grid in OSG

2009-08-10 Thread Andrew Thompson
Hi Chris, Thanks for the heads up, I was digging around and found the drawImplementation method in Drawable myself so decided to give it a go. However I've had less than spectacular results! My first test was to take the code from ShapeDrawable that draws a box. Here it is for completeness sa

Re: [osg-users] Infinite Grid in OSG

2009-08-07 Thread Andrew Thompson
Ok, wise advise, just since this is a grid (Rendered once) per frame, I will need to resize the grid lines/thicknesses/spacing on every frame (as I zoom/pan my scene). I guess I have enough to go digging now though, certainly you've given me some good ideas, Thank you, Andrew -

Re: [osg-users] Infinite Grid in OSG

2009-08-07 Thread Andrew Thompson
Ok, so I could use a HUD and attach behind my scene - clever, I like it :-) Now the question is, how do I get access to just glBegin/glEnd? I was thinking of creating a class that inherits ShapeDrawable and just rendering my lines (I have found some legacy code that calculates the lines and sub

Re: [osg-users] Infinite Grid in OSG

2009-08-07 Thread Andrew Thompson
Edit: Perhaps another way of asking this question - I know how to render my grid using OpenGL calls, I would basically use glBegin(GL_LINES) / glEnd and draw the lines at the appropriate spacing and thickness. So the question is - is there a way to directly push something onto the GL renderi

[osg-users] Infinite Grid in OSG

2009-08-07 Thread Andrew Thompson
Hi there, A simple question, would anyone know how I could implement an infinite grid in OSG? This is an image showing what I am trying to achieve. [Image: http://i137.photobucket.com/albums/q217/andyb1979/InfiniteGrid.png ] Ideally as the user zooms in/out I would like the grid to subdivide

[osg-users] Using OSG Shadow mapping to compute a shadow map on a texture or bitmap

2009-08-07 Thread Andrew Thompson
Hi there, I have a rather strange problem that I would like to tackle using OSG, I wonder if anyone could offer some advice on whether it is possible or not? In brief, the application I am working on must allow users to detect what parts of a scene containing in a large CAD model are and are n

Re: [osg-users] complete copy of my scenegraph

2009-07-31 Thread Andrew Thompson
Hi, I have no idea if deep copy will solve your problem, but if it doesn't, another way (albeit expensive in CPU) will be to serialize/deserialize your entire scene via memory streams, thereby forcing a copy operation. Here, I had a thread where I asked about this, http://forum.openscenegraph

Re: [osg-users] Truncated Cone with spheric base

2009-07-31 Thread Andrew Thompson
Hi there Don't use the ShapeDrawable class, these are pretty slow and inefficient. Instead, draw the geometry yourself. Here - this function will create a cone with different top/bottom radius, and a length. Variables needed by the function include startRadius (float) endRadius (float) lengt

[osg-users] Perspective / Orthogonal projection matrix with CameraManipulator

2009-07-30 Thread Andrew Thompson
Hi there, I am using a custom CameraManipulator class (inheriting osgGA::MatrixManipulator) which is added to my scene after the OpenSceneGraph is initialised The CameraManipulator has two member variables I've added, a Vec3d target and position. These are used to create a projection matrix b

Re: [osg-users] Simple way to determine if a point is inside a geometry

2009-07-30 Thread Andrew Thompson
Yep, will do, its a great start though, thanks -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15658#15658 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/

Re: [osg-users] Serializing / Deserializing an osg::Node to memory pointer

2009-07-30 Thread Andrew Thompson
Hi all, An update on this problem, I've managed to solve it by the following steps [list=] [*]As I was operating in Debug mode, the IVE plugin required "zlib1d.dll" - so I copy/pasted zlib1.dll and renamed it to "d" and put this in C:\. I can confirm this works now in debug and release [*]Then

Re: [osg-users] Simple way to determine if a point is inside a geometry

2009-07-30 Thread Andrew Thompson
Hi Gordon, Thanks for your reply, I'm going to give that a go. First check - see if its in the bounding sphere of the PAT Second check - go for the bounding boxes of the drawables. I guess I'll need to inverse transform my point by the PAT's matrix first? Anyway good to know it's not too diff

[osg-users] Simple way to determine if a point is inside a geometry

2009-07-29 Thread Andrew Thompson
Hi there, Given a single object in my scene graph defined by the hierachy PositionAttitudeTransform (x1) | Geode (x1) | Geometry (x1) | Drawables (x Many) Is there a simple way to determine if a point location is inside the geometry, taking into account transforms applied by the PAT?

Re: [osg-users] Serializing / Deserializing an osg::Node to memory pointer

2009-07-29 Thread Andrew Thompson
To clarify this problem, I have checked my environment variables and added the plugins directory to PATH, I also was missing zlib1.dll which I have copied to the bin directory. Now when I go to the command prompt and type "osgconv --format ive" it comes back with a ReaderWriter for the IVE f

Re: [osg-users] Serializing / Deserializing an osg::Node to memory pointer

2009-07-29 Thread Andrew Thompson
Hi there, I finally got around to implementing this functionality (!!) - it works great with "osg" as the target format, but with "ive" the getReaderWriteForExtension call returns null. I assume I am missing an environment variable or something and the OSG cannot find the correct plugin? For

Re: [osg-users] Serializing / Deserializing an osg::Node to memory pointer

2009-06-05 Thread Andrew Thompson
Hi Robert, Thank you for your reply. Some quick questions for you - By custom nodes do you mean my own classes inheriting a node? If so, no I don't have these. I am creating geometry inside Geode's in code, but the structure is very simple. As for the .ive format, I'll do a bit of googling

Re: [osg-users] Serializing / Deserializing an osg::Node to memory pointer

2009-06-05 Thread Andrew Thompson
... To add to the above, I just noticed osg::ReaderWriter::writeNode has an overload accepting a std::ostream I imagine this is what I'm looking for - the ability to read and write nodes to a memory stream. Does anyone have any experience this this overload and can offer comment on it? Thank

[osg-users] Serializing / Deserializing an osg::Node to memory pointer

2009-06-05 Thread Andrew Thompson
Hi there, This is the first time I've posted on these boards, I wonder if any of you guys can help me out? I am developing a CAD application that uses OpenSceneGraph and I need to implement custom serialization of the CAD data to/from disk. This requires saving individual nodes and their chil