OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

How to add a camera


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Nico Kruithof
Guest





PostPosted: Tue Feb 21, 2017 8:21 am    Post subject:
How to add a camera
Reply with quote

Hi all,


There are two ways to add a camera to a view. First, there is the addSlave (osgcamera example) and second, you can add the camera to a group node in the scene (osgprerendercubemap example). What is the difference between the two and when would you use one or the other?

--
Nico Kruithofnghk.nl

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10859

PostPosted: Tue Feb 21, 2017 8:47 am    Post subject:
How to add a camera
Reply with quote

Hi Nico,

On 21 February 2017 at 08:19, Nico Kruithof <> wrote:
Quote:
There are two ways to add a camera to a view. First, there is the addSlave
(osgcamera example) and second, you can add the camera to a group node in
the scene (osgprerendercubemap example). What is the difference between the
two and when would you use one or the other?

You can implement the same effects with both approaches so it's mainly
down to conceptual and practical considerations.

Conceptually a Camera assigned to a View(er) as a master Camera or
slave Camera provides guidance on how the viewer views the scene. So
if you had a HMD you would naturally use two slave Camera, one for
each eye. Also if you want to do distortion correction again this
would likely be conceptually something associated with how you view
the scene so again would naturally fit as a slave Camera. Practically
in both these cases configuring the viewer with different combinations
of slave Camera enables you to vary how the scene is viewed on
different physical devices, completely decoupled from the scene graph.

With effects like shadows or reflections conceptually these are
related to the scene that you are viewing rather than how you are
viewing it, so naturally you would put such a Camrea into the scene
graph itself. Again practically this is a good fit as you can
serialize out the scene graph and then load into a application that
has a completely different viewer setup and it'll work, i.e. you can
move from a desktop to HMD or a powerwall and have the scene still
look as intended without having to hardware the application to it.

The design of osg::Camera and osgViewer is based on these
concepts/practical consideration, the class relationships and naming
all fall naturally from this desire to be able to conceptually and
practically decouple the needs of the viewer from the needs of the
scene.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
nicokruithof (Nico Kruithof)
User


Joined: 20 Apr 2009
Posts: 21

PostPosted: Tue Feb 21, 2017 10:40 am    Post subject:
How to add a camera
Reply with quote

Could it be that slave camera's show up in the stats viewer, but children in the scene graph do not?

Nico


On Tue, Feb 21, 2017 at 9:45 AM, Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Nico,

On 21 February 2017 at 08:19, Nico Kruithof < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
There are two ways to add a camera to a view. First, there is the addSlave
(osgcamera example) and second, you can add the camera to a group node in
the scene (osgprerendercubemap example). What is the difference between the
two and when would you use one or the other?

You can implement the same effects with both approaches so it's mainly
down to conceptual and practical considerations.

Conceptually a Camera assigned to a View(er) as a master Camera or
slave Camera provides guidance on how the viewer views the scene.  So
if you had a HMD you would naturally use two slave Camera, one for
each eye.  Also if you want to do distortion correction again this
would likely be conceptually something associated with how you view
the scene so again would naturally fit as a slave Camera.  Practically
in both these cases configuring the viewer with different combinations
of slave Camera enables you to vary how the scene is viewed on
different physical devices, completely decoupled from the scene graph.

With effects like shadows or reflections conceptually these are
related to the scene that you are viewing rather than how you are
viewing it, so naturally you would put such a Camrea into the scene
graph itself.  Again practically this is a good fit as you can
serialize out the scene graph and then load into a application that
has a completely different viewer setup and it'll work, i.e. you can
move from a desktop to HMD or a powerwall and have the scene still
look as intended without having to hardware the application to it.

The design of osg::Camera and osgViewer is based on these
concepts/practical consideration, the class relationships and naming
all fall naturally from this desire to be able to conceptually and
practically decouple the needs of the viewer from the needs of the
scene.

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Nico Kruithofnghk.nl

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10859

PostPosted: Tue Feb 21, 2017 10:47 am    Post subject:
How to add a camera
Reply with quote

On 21 February 2017 at 10:38, Nico Kruithof <> wrote:
Quote:
Could it be that slave camera's show up in the stats viewer, but children in
the scene graph do not?

The viewer timing stats list the viewer Camera's so includes slaves.

The scene stats don't separate out the scene graph Cameras.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Nico Kruithof
Guest





PostPosted: Tue Feb 21, 2017 11:11 am    Post subject:
How to add a camera
Reply with quote

Ah, ok. Thanks for the help.

Nico


On Tue, Feb 21, 2017 at 11:44 AM, Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
On 21 February 2017 at 10:38, Nico Kruithof < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Could it be that slave camera's show up in the stats viewer, but children in
the scene graph do not?

The viewer timing stats list the viewer Camera's so includes slaves.

The scene stats don't separate out the scene graph Cameras.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--

Nico Kruithof, PhD

Computer Scientist




Pedro de Medinalaan 25
1086 XP Amsterdam
The Netherlands

T +31 20 707 4674
F +31 20 707 4669
E  (
Only registered users can see emails on this board!
Get registred or enter the forums!
)
W www.cruden.com

------------------
Post generated by Mail2Forum
Back to top
Steal
User


Joined: 26 Jan 2017
Posts: 56

PostPosted: Tue Feb 21, 2017 5:25 pm    Post subject:
Reply with quote

Hi,

Wow great answer Robert. Maybe the topic title deserves to be changed to 'viewer slaves vs. scene cameras' or something like it.

Thank you!

Cheers,
Johny
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How to get the camera's roll pitch an... xdfanfan General 1 Sat Apr 01, 2017 8:43 am View latest post
No new posts Multisampled FBO camera with shared d... HonzaS General 0 Fri Mar 17, 2017 3:19 pm View latest post
No new posts Is it possible to temporarily redirec... wernerM General 3 Thu Mar 09, 2017 2:13 pm View latest post
No new posts About separate rendering of a slave c... wernerM General 0 Tue Mar 07, 2017 3:14 pm View latest post
No new posts Camera resize vs setViewport ravidavi General 3 Fri Feb 24, 2017 3:13 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP