Re: [osg-users] Node with different projection/view matrix fixed pipeline

2020-01-21 Thread Robert Osfield
The way I'd tackle dragging of objects in model space that are billboarded 
icons would be to project the mouse coords into clip coords then into 
object space using the matrices inverse of the (projection * view * 
model).  You'd also need to compute the depth to use, this could be 
computed by taking the original object space into clip coords, then using 
this in the mouse clip coords to object space multiplication.

Hopefully this makes sense.  It's a bit of advance topic as it requires 
understanding how matrices are used in the scenegraph/3D graphics.

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/27951025-2b7f-451e-ab1f-197771929a93%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Node with different projection/view matrix fixed pipeline

2020-01-17 Thread Catalin
Hi Robert,

I have an old code, as you know. Some objects are rendered with OpenGL, but 
before that the ViewMatrix is set to identity, as the the objects are 
having their position computed as follow:

ObjectPositionView = ViewMatrix * ObjectPosition + 2D Move Vector(x,y) in 
view space

ObjectPositionView already contains the ViewMatrix, so I am feeding it 
directly to the Open GL.

Those object are some billboards but with the option to be moved in the 
view space, like a 2D move.

If I give directly the ObjectPosition to OSG, it works fine with billboards 
but I don't know how to incorporated the 2D Move Vector, that vector is in 
the view space.

On Thursday, 16 January 2020 10:18:59 UTC+2, Robert Osfield wrote:
>
> Hi Catalin,
>
> Could you explain what you are trying to do with the rendering of this 
> node? What you are attempting to do will guide the best way to implement 
> what you need.
>
> Robert.
>
> On Thu, 16 Jan 2020 at 07:33, Catalin > 
> wrote:
>
>> Hi,
>>
>> Is there a way to change the view matrix or projection matrix for a just 
>> a specific node in fixed pipeline mode?
>>
>>
>> ___
>> osg-users mailing list
>> osg-...@lists.openscenegraph.org 
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/2174a736-ca96-4fba-a263-bd4be6d1a8dc%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Node with different projection/view matrix fixed pipeline

2020-01-16 Thread Catalin
Hi Robert,

Yes I am using osg::Billboard for that now, but the user in the old code
had possibility to move those billboards in view space with the mouse,
left,right,up down.

The green tags are attached to some other objects, but the user can move it
in view space with the mouse, left,right,up down.

See the green tags.

https://i.imgur.com/bjQnlBq.png

On Thu, 16 Jan 2020 at 13:18, Robert Osfield 
wrote:

> Hi Catalin,
>
> I'm still a bit confused from your explanation.
>
> Is it simply that you want a 2D overlay on your scene?  Have a look at the
> osghud example - this uses an osg::Camera to set a user define view and
> projection matrix for it's subgraph.
>
> If you want object to be rendered like billboards within the 3D world then
> there is the osg::Billboard and osg::AutoTransform classes.
>
> Robert.
>
> On Thu, 16 Jan 2020 at 09:07, Catalin  wrote:
>
>> Hi Robert,
>>
>> I have an old code, as you know. Some objects are rendered with OpenGL,
>> but before that the ViewMatrix is set to identity, as the the objects are
>> having their position computed as follow:
>>
>> ObjectPositionView = ViewMatrix * ObjectPosition + 2D Move Vector(x,y) in
>> view space
>>
>> ObjectPositionView already contains the ViewMatrix, so I am feeding it
>> directly to the Open GL.
>>
>> Those object are some billboards but with the option to be moved in the
>> view space, like a 2D move.
>>
>> If I give directly the ObjectPosition to OSG, it works fine with
>> billboards but I don't know how to incorporated the 2D Move Vector, that
>> vector is in the view space.
>>
>> On Thu, 16 Jan 2020 at 10:18, Robert Osfield 
>> wrote:
>>
>>> Hi Catalin,
>>>
>>> Could you explain what you are trying to do with the rendering of this
>>> node? What you are attempting to do will guide the best way to implement
>>> what you need.
>>>
>>> Robert.
>>>
>>> On Thu, 16 Jan 2020 at 07:33, Catalin  wrote:
>>>
 Hi,

 Is there a way to change the view matrix or projection matrix for a
 just a specific node in fixed pipeline mode?


 ___
 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
>>
> ___
> 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] Node with different projection/view matrix fixed pipeline

2020-01-16 Thread Robert Osfield
Hi Catalin,

I'm still a bit confused from your explanation.

Is it simply that you want a 2D overlay on your scene?  Have a look at the
osghud example - this uses an osg::Camera to set a user define view and
projection matrix for it's subgraph.

If you want object to be rendered like billboards within the 3D world then
there is the osg::Billboard and osg::AutoTransform classes.

Robert.

On Thu, 16 Jan 2020 at 09:07, Catalin  wrote:

> Hi Robert,
>
> I have an old code, as you know. Some objects are rendered with OpenGL,
> but before that the ViewMatrix is set to identity, as the the objects are
> having their position computed as follow:
>
> ObjectPositionView = ViewMatrix * ObjectPosition + 2D Move Vector(x,y) in
> view space
>
> ObjectPositionView already contains the ViewMatrix, so I am feeding it
> directly to the Open GL.
>
> Those object are some billboards but with the option to be moved in the
> view space, like a 2D move.
>
> If I give directly the ObjectPosition to OSG, it works fine with
> billboards but I don't know how to incorporated the 2D Move Vector, that
> vector is in the view space.
>
> On Thu, 16 Jan 2020 at 10:18, Robert Osfield 
> wrote:
>
>> Hi Catalin,
>>
>> Could you explain what you are trying to do with the rendering of this
>> node? What you are attempting to do will guide the best way to implement
>> what you need.
>>
>> Robert.
>>
>> On Thu, 16 Jan 2020 at 07:33, Catalin  wrote:
>>
>>> Hi,
>>>
>>> Is there a way to change the view matrix or projection matrix for a just
>>> a specific node in fixed pipeline mode?
>>>
>>>
>>> ___
>>> 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
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BWHVMQyX5QVbJS5NRBvvu7B3CFmu13%2BpDcGFi4TQw_jRw%40mail.gmail.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BWHVMQyX5QVbJS5NRBvvu7B3CFmu13%2BpDcGFi4TQw_jRw%40mail.gmail.com.


Re: [osg-users] Node with different projection/view matrix fixed pipeline

2020-01-16 Thread Catalin
Hi Robert,

I have an old code, as you know. Some objects are rendered with OpenGL, but
before that the ViewMatrix is set to identity, as the the objects are
having their position computed as follow:

ObjectPositionView = ViewMatrix * ObjectPosition + 2D Move Vector(x,y) in
view space

ObjectPositionView already contains the ViewMatrix, so I am feeding it
directly to the Open GL.

Those object are some billboards but with the option to be moved in the
view space, like a 2D move.

If I give directly the ObjectPosition to OSG, it works fine with billboards
but I don't know how to incorporated the 2D Move Vector, that vector is in
the view space.

On Thu, 16 Jan 2020 at 10:18, Robert Osfield 
wrote:

> Hi Catalin,
>
> Could you explain what you are trying to do with the rendering of this
> node? What you are attempting to do will guide the best way to implement
> what you need.
>
> Robert.
>
> On Thu, 16 Jan 2020 at 07:33, Catalin  wrote:
>
>> Hi,
>>
>> Is there a way to change the view matrix or projection matrix for a just
>> a specific node in fixed pipeline mode?
>>
>>
>> ___
>> 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] Node with different projection/view matrix fixed pipeline

2020-01-16 Thread Robert Osfield
Hi Catalin,

Could you explain what you are trying to do with the rendering of this
node? What you are attempting to do will guide the best way to implement
what you need.

Robert.

On Thu, 16 Jan 2020 at 07:33, Catalin  wrote:

> Hi,
>
> Is there a way to change the view matrix or projection matrix for a just a
> specific node in fixed pipeline mode?
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BVWkp9CrmKovoj76JcWRd69fnpjf1GAwa%2B7y3vQZe2kOA%40mail.gmail.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BVWkp9CrmKovoj76JcWRd69fnpjf1GAwa%2B7y3vQZe2kOA%40mail.gmail.com.


[osg-users] Node with different projection/view matrix fixed pipeline

2020-01-16 Thread Catalin
> Hi,
>
> Is there a way to change the view matrix or projection matrix for a just a
> specific node in fixed pipeline mode?
>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Node with different projection/view matrix fixed pipeline

2020-01-15 Thread Catalin
Hi,

Is there a way to change the view matrix or projection matrix for a just a
specific node in fixed pipeline mode?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org