Re: [osg-users] Calculating the volume of a model through OSG

2008-11-27 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
Another simple way of calculating the volume of a arbitary closed 3d mesh is Choose an arbitary point ( let's call it o ) For each triangle with vertices ( a,b,c ) Calculate the volume of the tetrahedron ( a,b,c,o ) using a scalar triple product ( ((b-a)x(c-a)).(o-a)/3 ). Add the volumes of

Re: [osg-users] higher level shader chaining support?

2008-12-12 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
Hi Ferdi, I did make a first pass at this, at least in terms of reusing modules in different shaders. The glsl functionality has most the same tools as a C compiler. But is missing a few things. osg::Shader provides some the functionality C compiler and some functionality of the preprocessor (

[osg-users] Confused about Uniforms and StateSets.

2008-08-15 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
Hello, I'm using a geometry shader to do particle animation for a splash special effect. I am using a few uniforms, one of which is the time at which the splash starts and others that contain values that are shared among the different splashes. I am applying the StateSet containing the

Re: [osg-users] Confused about Uniforms and StateSets.

2008-08-15 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
, Colin (GE EntSol, Intelligent Platforms) [EMAIL PROTECTED] wrote: Hello, I'm using a geometry shader to do particle animation for a splash special effect. I am using a few uniforms, one of which is the time at which the splash starts and others that contain values that are shared among

[osg-users] Shaders, osg::notify and IP

2008-09-24 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
Hi all, My colleague was recently doing some debugging and found that when OSG_NOTIFY_LEVEL is INFO or higher all of the shader code comes out as debug. Luckily because of the way the osg::notify code is written we can prevent any slightly osg savvy 3rd party getting hold of my shaders by setting

Re: [osg-users] Shaders, osg::notify and IP

2008-09-24 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
and source code, so even if someone did snoop and then reuse your work they would be open to a lawsuit. Robert On Wed, Sep 24, 2008 at 10:46 AM, Middleton, Colin (GE EntSol, Intelligent Platforms) [EMAIL PROTECTED] wrote: Hi all, My colleague was recently doing some debugging and found that when

Re: [osg-users] vpb: Spherical terrains?

2008-10-08 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield The pole looks weird. Is there any way to fix it? Poles are little bit awkward to fix with the simple quad tree approach used by the OSG (and many other whole whole techniques.)

Re: [osg-users] how to set per vertext attributes using osg

2009-07-10 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
I think my data items are going to be per Geode (e.g., thickness of a part), but I thought I still needed shader attributes instead of uniforms, because uniforms are per frame. Unless you're thinking I'd make an array of them where the indexing is the Geodes? Nope, you can

Re: [osg-users] how to set per vertext attributes using osg

2009-07-13 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
Attributes provide a faster way of changing vertex properties even on a per object basis, as it means all of your objects can share the same state. Changing the value of uniforms cause the creation of a new state. Lots of state changes can be very expensive. Sure, but some

Re: [osg-users] how to set per vertext attributes using osg

2009-07-13 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
As well as hardware state changes he also talks about the CPU cost of doing the sorting being an issue. That was what my suggestion will help with as it means that OSG has less states to sort, as all objects of the same type will have the same state as opposed to having state

Re: [osg-users] Updating Rotation Matrix - Quaternion

2009-09-02 Thread Middleton, Colin (GE EntSol, Intelligent Platforms)
What I need to do is invert the rotation. I'm not aware of a invert functionality on Quat but you could create a rotation matrix from the Quat, invert that, and get a quaternion back. All quaternions contains a vector ( x,y,z ) and a scalar (w ). For a rotation quaternion the