Re: [osg-users] preDrawCallback?

2009-05-02 Thread Robert Osfield
Hi Cory,

OpenGL calls used to fill a background colour will be the faster way
to accomplish a gradient background and it'll be a portable solution.

Robert.

On Sat, May 2, 2009 at 1:24 AM, Cory Riddell c...@codeware.com wrote:
 If I want to draw something in the client area of the window OSG is
 rendering into (via Windows GDI calls), would I do this in a
 preDrawCallback? (after setting an appropriate ClearMask in the camera)

 I want to have a gradient background and I'm thinking that I could do
 this easily with the GradientFill() function. I realize I could
 accomplish the same thing using methods from the osgHud example, but I'm
 thinking that a GDI call would be faster.

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

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


Re: [osg-users] Set view direction

2009-05-02 Thread Robert Osfield
Hi Martin,

You can't both set the view matrix by hand and have a camera
manipulator running, you have to do one or other, otherwise the camera
manipulator will just overwrite your view matrix settings.

Robert.

On Fri, May 1, 2009 at 11:10 PM, Martin Beckett m...@mgbeckett.com wrote:
 I am trying to switch the current view to show th emodel from top/front/side 
 etc.
 I'm trying both getCamer()-setViewMatrix() and trackballmanipulator 
 setRotation() but I can't seem to work out the correct angle and X/Y/Z_AXIS

 Martin

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





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

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


Re: [osg-users] VPB cURL dependency

2009-05-02 Thread Robert Osfield
Hi Paul,

You are write, the FIND_PACKAGE(CURL) isn't required.  Now removed and
checked into svn/trunk.

Robert.

On Sat, May 2, 2009 at 2:26 AM, Paul Martz pma...@skew-matrix.com wrote:
 Hi Robert -- I'm curious about the cURL dependency in VPB's CMakeLists.txt
 file. Was this left in from old development? VPB seems to build and link
 fine with this dependency removed.

 Paul Martz
 Skew Matrix Software LLC
 http://www.skew-matrix.com
 +1 303 859 9466

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


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


Re: [osg-users] What's the mime type of .ive file?

2009-05-02 Thread Robert Osfield
2009/5/2 xyc508 xyc...@163.com:
 Hello,all

 Who can tell that What's the mime type of .ive file?

Nobody.  There isn't one.

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


Re: [osg-users] Shadows: Application crashing at viewer.renderingTraversals()

2009-05-02 Thread Paul
Bump...

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





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


Re: [osg-users] preDrawCallback?

2009-05-02 Thread Paul Martz
I don't think GDI is buffer-savvy, so there's no way to tell it to draw into
the back buffer. (10 years ago, when HP made their own graphics cards, we
developed a solution for mixing GDI/Xlib with OpenGL, and it was quite
flexible. No one else ever implemented such a scheme. As a result, GDI/Xlib
rendering into an OpenGL window is unsupported and will produce undefined
results.)

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Cory
Riddell
Sent: Friday, May 01, 2009 6:25 PM
To: OpenSceneGraph Users
Subject: [osg-users] preDrawCallback?

If I want to draw something in the client area of the window OSG is
rendering into (via Windows GDI calls), would I do this in a
preDrawCallback? (after setting an appropriate ClearMask in the camera)

I want to have a gradient background and I'm thinking that I could do this
easily with the GradientFill() function. I realize I could accomplish the
same thing using methods from the osgHud example, but I'm thinking that a
GDI call would be faster.

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

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


Re: [osg-users] Set view direction

2009-05-02 Thread Martin Beckett
So to switch to a view I should just derive from TrackBallManipulator and add 
functions to modify the rotations matrix and then call home()?

I tried this but it needed changes to MatrixManipulator I posted in submission 
- to allow calculatehomeposition to change _up.

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





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


[osg-users] problems with osgFX Effects

2009-05-02 Thread NeoM

I've tried the osgfxbrowser example, and it works fine if I compile it in debug 
mode, but when i use release mode the only effect that works is scribe, when I 
select the other effects the model disappears and I get this warning:


 Warning: osgFX::Validator: could not find any techniques compatible with the 
 current OpenGL context


I've been using osg for a while and it works perfect in both debug and release 
modes.

PD: I've tried to use the osgFX:Cartoon effect in my project and it happens the 
same,it only works in debug mode

Thanks, NeoM.[/quote]

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





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


[osg-users] [beginner question] How to render from custom camera?

2009-05-02 Thread Real Name

Hi everybody,

I am using osgART for an AR project I'm currently working on, which joins osg 
and ARTookit -- but since my question is rather regarded to osg, I'm asking you 
folks...

In osgART the developers seem to create a custom camera they place inside the 
scenegraph, under a transform node which continuously gets updated regarding to 
ARToolkit tracking results.

Well, I'm using a CompositeViewer to create two views in seperate render 
windows rendering the same scene. Only one view is showing the scene updated 
from AR tracking, the other one is supposed to show the scene from a position I 
want to be able to modify in my code.

For consistency reasons I really want to create the camera for my second view 
the same way osgART does in the first view, this looks pretty straight forward 
in their code: 

Code:
osg::Camera* 
Calibration::createCamera() const
{
osg::Camera* cam = new osg::Camera();
cam-setRenderOrder(osg::Camera::NESTED_RENDER);
cam-setProjectionMatrix(_projection);
cam-setReferenceFrame(osg::Transform::ABSOLUTE_RF);
cam-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

return cam; 
}


In the example code which is provided the so created camera simply gets added 
to the scene graph in some position (below this AR-transform node I mentioned 
above) and that's it. (Question aside: What happens to the default camera in 
this case? And: Can I get rid of it/replace it?)

If I do this the exactly same way my view seems to continue to render from the 
default camera created within the view instance. Do you have an idea what I am 
missing there? I debugged into osgART and couldn't find some view.addSlave() or 
something similar. 

Unfortunately I'm a little overstrained by the tremendous extent of osg, the 
available guides seem to be scattered about several websites, wikis, tutorials, 
etc. while the actual (doxygen) documentation is very sketchy and little 
illuminating. as you might know this makes it very difficult for beginners to 
get into it. I found examples using osgProducer::Viewer, or Producer::Camera, 
slave cameras and many funny things I wonder why there have to be so many 
different ways of implementing, but I really would like to keep my way of 
creating this cam consistent to the way it is done in osgART -- there really 
has to be a very simple way to do this in a clean way but I cannot find it. 

Thanks for reading through all of this, and thanks in advance for your help.

PS: A few weeks ago I tried to replace the default viewer camera by the custom 
camera to not have a camera that is not needed anyway but I failed finding a 
way to do this. Is this possible anyway?

PPS: What is it about this default camera anyway? It looks kind of weird to me 
that the default camera is not part of the scenegraph, after all it's a node 
like everyone else. Or did I get something wrong here? Maybe someone can point 
me to a place where this whole osg-architecture is explained in detail so this 
is clarified once and for all IN A COMPACT WAY? (If I had enough time, I would 
enjoy reading into everything I can find but unfortunately I haven't...) Every 
time I debug into osg::Viewer I wonder how this all works together...

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





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


[osg-users] .osg file format specification?

2009-05-02 Thread OSG Newbie

Hi,
Where can I find for file specification for .osg file? I would like to write an 
exporter for Maya that exports mesh, texture, shader and animation in .osg 
format. Dose .osg support shader and animation export?

Thank you.

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





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


Re: [osg-users] osgAnimation supported files

2009-05-02 Thread Robert Risco

robertosfield wrote:
 Hi Robert?
 
 Could please change your forum account so it's different from Robert,
 perhaps you're full name so that people on the mailing list and forum
 can see straight away that it's not another Robert so such as myself
 or one of the many others.
 
 Robert (Osfield).
 
 
 On Tue, Apr 28, 2009 at 2:41 PM, Robert  wrote:
 
  Hi,
  
  I just wanted to know which files are supported by osgAnimation. .osg 
  only?
  
  Thank you.
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=10977#10977
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  
 
 C
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


Done.

And thanks Cedric, thats what I wanted to know.

Robert (Risco)

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





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


Re: [osg-users] .osg file format specification?

2009-05-02 Thread Paul Martz
You should search the archives, this has been asked before.

There is no spec, it is a text dump of fields in OSG classes. To see what
info is read and written, examine the source code in src/osgPlugins/osg.

The best way to create a plugin as you describe would be to build a scene
graph, then call osgDB::writeNodeFile and let the existing code create the
.osg file for you. I have created a similar plugin for PolyTrans. And I also
believe someone has written such a plugin for Maya, so you might want to do
a search of the Web or this mailing list before you undertake development.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of OSG Newbie
Sent: Saturday, May 02, 2009 9:06 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] .osg file format specification?


Hi,
Where can I find for file specification for .osg file? I would like to write
an exporter for Maya that exports mesh, texture, shader and animation in
.osg format. Dose .osg support shader and animation export?

Thank you.

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





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

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


Re: [osg-users] [beginner question] How to render from custom camera?

2009-05-02 Thread Paul Martz
Hi Real --

The code you quoted is rather odd in that it doesn't set the View matrix. I
can only assume that some further Camera configuration must be done
elsewhere.

I'm also not sure why that Camera node would be placed as a child under a
Transform node, because the Camera reference frame is set to ABSOLUTE_RF,
which basically causes it to ignore the effects of any parent
transformations.

Perhaps this custom Camera classis taking the accumulated transform from its
parents and incorporating it into a View matrix that it sets every frame?
This is just speculation.

Not sure why your own code wouldn't work. If, as I suspect, more Camera
configuration is done on your AR Camera elsewhere, and you have failed to do
similar configuration to your Camera (such as set the View matrix), then I
would expect to encounter some problems.

Regarding the documentation, this has been discussed before. Search the
archives. In summary, someone who wants good docs needs to step forward and
fund it. I would gladly take on such a client.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Real Name
Sent: Saturday, May 02, 2009 9:00 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] [beginner question] How to render from custom camera?


Hi everybody,

I am using osgART for an AR project I'm currently working on, which joins
osg and ARTookit -- but since my question is rather regarded to osg, I'm
asking you folks...

In osgART the developers seem to create a custom camera they place inside
the scenegraph, under a transform node which continuously gets updated
regarding to ARToolkit tracking results.

Well, I'm using a CompositeViewer to create two views in seperate render
windows rendering the same scene. Only one view is showing the scene updated
from AR tracking, the other one is supposed to show the scene from a
position I want to be able to modify in my code.

For consistency reasons I really want to create the camera for my second
view the same way osgART does in the first view, this looks pretty straight
forward in their code: 

Code:
osg::Camera*
Calibration::createCamera() const
{
osg::Camera* cam = new osg::Camera();
cam-setRenderOrder(osg::Camera::NESTED_RENDER);
cam-setProjectionMatrix(_projection);
cam-setReferenceFrame(osg::Transform::ABSOLUTE_RF);

cam-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

return cam; 
}


In the example code which is provided the so created camera simply gets
added to the scene graph in some position (below this AR-transform node I
mentioned above) and that's it. (Question aside: What happens to the default
camera in this case? And: Can I get rid of it/replace it?)

If I do this the exactly same way my view seems to continue to render from
the default camera created within the view instance. Do you have an idea
what I am missing there? I debugged into osgART and couldn't find some
view.addSlave() or something similar. 

Unfortunately I'm a little overstrained by the tremendous extent of osg, the
available guides seem to be scattered about several websites, wikis,
tutorials, etc. while the actual (doxygen) documentation is very sketchy and
little illuminating. as you might know this makes it very difficult for
beginners to get into it. I found examples using osgProducer::Viewer, or
Producer::Camera, slave cameras and many funny things I wonder why there
have to be so many different ways of implementing, but I really would like
to keep my way of creating this cam consistent to the way it is done in
osgART -- there really has to be a very simple way to do this in a clean way
but I cannot find it. 

Thanks for reading through all of this, and thanks in advance for your help.

PS: A few weeks ago I tried to replace the default viewer camera by the
custom camera to not have a camera that is not needed anyway but I failed
finding a way to do this. Is this possible anyway?

PPS: What is it about this default camera anyway? It looks kind of weird to
me that the default camera is not part of the scenegraph, after all it's a
node like everyone else. Or did I get something wrong here? Maybe someone
can point me to a place where this whole osg-architecture is explained in
detail so this is clarified once and for all IN A COMPACT WAY? (If I had
enough time, I would enjoy reading into everything I can find but
unfortunately I haven't...) Every time I debug into osg::Viewer I wonder how
this all works together...

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





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

___

Re: [osg-users] problems with osgFX Effects

2009-05-02 Thread Robert Osfield
Hi NeoM,

I haven't heard of problems with osgfxbrowser like this before.  What
OS/Hardware/drivers are you using?  What OSG version are you using?

Have you tried updating your OpenGL drivers.  Have you tried any other
hardware/OS combinations?

Robert.

On Sat, May 2, 2009 at 3:31 PM, NeoM metal_mecan...@hotmail.com wrote:

 I've tried the osgfxbrowser example, and it works fine if I compile it in 
 debug mode, but when i use release mode the only effect that works is scribe, 
 when I select the other effects the model disappears and I get this warning:


 Warning: osgFX::Validator: could not find any techniques compatible with the 
 current OpenGL context


 I've been using osg for a while and it works perfect in both debug and 
 release modes.

 PD: I've tried to use the osgFX:Cartoon effect in my project and it happens 
 the same,it only works in debug mode

 Thanks, NeoM.[/quote]

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





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

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


Re: [osg-users] osgAnimation and 3ds max exporter

2009-05-02 Thread Botorabi
hi tomhog,

send me a pm with your email address so i send you the current state of the 
exporter.

cheers
boto


Virtual Reality Chat (VRC), a free 3D chat application. http://www.vr-fun.net

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





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


Re: [osg-users] Shadows: Application crashing at viewer.renderingTraversals()

2009-05-02 Thread Robert Osfield
On Sat, May 2, 2009 at 2:39 PM, Paul gaffe...@gmail.com wrote:
 Bump...

Bang.

Stack trace required.

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


Re: [osg-users] Shadows: Application crashing at viewer.renderingTraversals()

2009-05-02 Thread Gordon Tomlinson
Sorry all the psychics are on vacation at this time


__
Gordon Tomlinson 

gor...@gordontomlinson.com
IM: gordon3db...@3dscenegraph.com
www.vis-sim.com www.gordontomlinson.com 

__

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul
Sent: Saturday, May 02, 2009 9:39 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Shadows: Application crashing at
viewer.renderingTraversals()

Bump...

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





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

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


Re: [osg-users] problems with osgFX Effects

2009-05-02 Thread NeoM
I have a Nvidia Geforce 7900 GS with the last drivers (182.50) and I use 
Windows XP.I have OSG 2.8.0 (and I'm using visual c++ 2008)

thanks for answering, I will try it

NeoM

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





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


Re: [osg-users] Warning message during VPB configure

2009-05-02 Thread Michael W. Hall
Robert,

I got the latest VPB from SVN and it built after I made the changes to
the files I mentioned below.  

I am using CMake 2.6-patch 2 on FC10 x86_64.  I only have OSG 2.80
installed.  I think all the issues I was having prior to this message
was that I had installed FC9 and then upgraded through FC10 betas.  I
finally last Thursday wiped my system and installed FC10 fresh and OSG
built.  The only issue I had was the Policy issue.

Michael

On Sat, 2009-05-02 at 08:58 +0100, Robert Osfield wrote:
 Hi Michael,
 
 What version of Cmake are you using?
 
 I'm using CMake 2.6.2 and don't see any warning.
 
 W.r.t you follow up email, it looks like VPB isn't finding the correct
 OSG version.  Do you have multiple versions of the OSG installed?
 Which version of the VPB are you using?
 
 Robert.
 
 On Fri, May 1, 2009 at 8:39 PM, Michael W. Hall hal...@att.net wrote:
  I get the following warning during the generate of ccmake for VPB:
 
  CMake Warning (dev) at src/vpb/CMakeLists.txt:38 (ADD_LIBRARY):
Policy CMP0003 should be set before this line.  Add code such as
 
  if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
  endif(COMMAND cmake_policy)
 
as early as possible but after the most recent call to
cmake_minimum_required or cmake_policy(VERSION).  This warning
  appears
because target vpb links to some libraries for which the linker
  must
search:
 
  -lpthread
 
and other libraries with known full path:
 
  /usr/local/lib64/libosg.so
 
CMake is adding directories in the second list to the linker search
  path in
case they are needed to find libraries from the first list (for
  backwards
compatibility with CMake 2.4).  Set policy CMP0003 to OLD or NEW to
  enable.
 
  Could someone tell me how to fix this?  My OSG is build and working.  I
  am running 2.8.0
 
  Thanks,
  Michael
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] Quat * Vec3 proposals - request for comments/help

2009-05-02 Thread Paul Fotheringham

--- On Tue, 21/4/09, J.P. Delport jpdelp...@csir.co.za wrote:

 From: J.P. Delport jpdelp...@csir.co.za
 Subject: [osg-users] Quat * Vec3 proposals - request for comments/help
 To: osg users osg-users@lists.openscenegraph.org
 Date: Tuesday, 21 April, 2009, 1:36 PM
 Hi all,
 
 it's been known for a while [1] that there are
 inconsistencies with the way OSG handles Quat * Vec3. In
 short: Quat * Vec3 is written in code as a post-multiply,
 but the result of the operation is as if a pre-multiply was
 performed. The attached test app also shows the problem
 (more on it later).
 
 [1]
 http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/21003
 and
 http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/33099
 
 What doesn't work?
 There are many examples that can be constructed of where a
 mathematical expression usings quats and vectors would not
 provide the expected results. See also [1]. The easiest one
 I could come up with is this:
 
 ((q1 * q2) * v) != (q1 * (q2 * v))
 
 Why are there not more complaints?

Well I curse this all the time, but not for the same reason. For me it's q1 * 
q2 that's annoying as I see it as the opposite of what I expect from the 
mathematics of applying a quaternion to a vector but then therein lies the 
problem.

Using operator* for matrix multiplications is fine as that mirrors precisely 
what you are doing with the matrices mathematically. Using operator* for 
quaternion multiplication is a loose analogy since you are actually doing 
q*v*q' mathematically when applying q to v. If you have two rotations, q1 
followed by q2 then you would get q2*q1*v*q1'*q2' mathematically and so I 
expect the interpretation of operator* to allow me to write q2*q1*v in code.

Of course that's just my interpretation and what I'm effectively saying within 
that interpretation is that it's quat * quat that is wrong but there's no way 
in the world you can swap that now! :)

Alternatively you could drop osg::Vec3::operator*( osg::Quat ) altogether and 
have osg::Vec3::apply( osg::Quat ) or osg::Vec3::rotate( osg::Quat ). I've used 
math libraries that do it this way (and where vec::operator*( quat ) is just 
that i.e. the mathematical multiplication rather than the full blown rotation.

I guess it depends on whether you value the brevity of operator* over the 
underlying mathematics. If operator* is still going to be used for applying a 
quaternion to a vector then I support the idea of making the multiplication 
orders consistent between quat/quat and vec/quat as per your proposal.

Making it consistent with OSG's row-major matrix multiplication is probably 
easier for coders who are not concerned with the details of the maths (and as I 
noted above it's not a workable solution to swap it now anyway).

Whatever happens I second the comment of Tanguy Fautre who asked for it to be 
documented clearly somewhere. :)

Anyway I hope you don't mind me chipping in. It certainly is interesting that 
there hasn't been more discussion. Maybe people just do what works and leave 
it. ;)

Paul Fotheringham.



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


Re: [osg-users] Quat * Vec3 proposals - request for comments/help

2009-05-02 Thread Paul Fotheringham

 Alternatively you could drop osg::Vec3::operator*(
 osg::Quat ) altogether and have osg::Vec3::apply( osg::Quat
 ) or osg::Vec3::rotate( osg::Quat ).

Woops. Of course I meant that it was osg::Quat::operator*( osg ::Vec3 ) that 
could be dropped. Sorry.

Paul Fotheringham.



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