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 

Convert from screen space to world space and back to screen space.


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
NavyBas
Newbie


Joined: 25 Apr 2012
Posts: 13

PostPosted: Thu Jun 22, 2017 6:14 pm    Post subject:
Convert from screen space to world space and back to screen space.
Reply with quote

Hello and thanks in advance for any assistance,

First question: What is the simplest way to convert from 2D space to 3D space with OSG?
Second question: What is the simplest way to convert from 3D space to 2D (screen) space with OSG?

I want to convert a screen coordinate to 3D (world) space, make a couple of 3D matrix rotations, then convert the resulting 3D coordinate back to screen space.

Thanks again for your help!

Cheers,
Zach
Back to top
View user's profile Send private message
NavyBas
Newbie


Joined: 25 Apr 2012
Posts: 13

PostPosted: Mon Jul 10, 2017 5:38 pm    Post subject:
Reply with quote

Just noticed the OSG Forum is back online after the outage. I don't know if this post got through the usual channels, so I just wanted to ping in case it did not.
Thanks again for any help in advance.

Zach
Back to top
View user's profile Send private message
Steal
User


Joined: 26 Jan 2017
Posts: 57

PostPosted: Mon Jul 10, 2017 7:16 pm    Post subject:
Reply with quote

Ou, that is a rather easy question. First of all, you'll like the lhs and rhs operations you can do with matrices, like mat * mat and vec * mat, I think work.

http://forum.openscenegraph.org/viewtopic.php?t=2292

Maybe this has something useful in it.
Back to top
View user's profile Send private message
NavyBas
Newbie


Joined: 25 Apr 2012
Posts: 13

PostPosted: Fri Jul 14, 2017 6:45 pm    Post subject:
Reply with quote

Thanks for the response Steal.

So, if I'm reading that post correctly, I can multiply my vector of (x, y, 0) by ModelInverse*ViewInverse*WindowMatrix, apply my 3D rotations, and then multiply the resulting vector by Model*View*Window to get back to screen-space.

I'll give it a try!

Zach

Steal wrote:
Ou, that is a rather easy question. First of all, you'll like the lhs and rhs operations you can do with matrices, like mat * mat and vec * mat, I think work.

http://forum.openscenegraph.org/viewtopic.php?t=2292

Maybe this has something useful in it.
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 add hello world/additional pro... tipking General 3 Mon Jun 12, 2017 10:25 am View latest post
No new posts how to convert osgb files to old version Haojia General 1 Fri Jun 02, 2017 4:35 pm View latest post
No new posts Disable rendering to screen wernerM General 0 Fri Apr 28, 2017 1:13 pm View latest post
No new posts My cow.osg just become different in a... Jiechang Guo General 2 Mon Apr 24, 2017 12:02 pm View latest post
No new posts FBX loader convert units options robertosfield Submission 1 Tue Apr 18, 2017 4:20 pm 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