No, the text node is parented to root,sibling with the earth node.I think if 
osg_ViewMatrixInverse is from eye position, the result could also be about 
-x000000 because gl_ModelViewMatrix*vertex is between -1 and 1, after 
transforming to world coords, the value could be millions.
  
  ------------------
  Failure is the mother of success.
 Wu Zhicheng


  
  

 

 ------------------ Original ------------------
  From:  "Solkar Graphics";<[email protected]>;
 Date:  Thu, Jul 3, 2014 08:13 AM
 To:  "osg-users"<[email protected]>; 
 
 Subject:  Re: [osg-users] how to get the real world coordinates(x, y,z) in 
shader

 


ttaw wrote:
> Following is the symptoms: There's an earth node under scene root whose 
> coordinates are between 5000000 and 7000000. And also an ortho-projecting HUD 
> camera with width 1600 and height 900 is under root.Under the HUD camera, a 
> geode with text whose position is (1300,500,0) and whose size is (200,75) 
> exists.Eye position is above the earth surface. The x coords of the geode I 
> got by osg_viewMatrixInverse*gl_ModelViewMatrix*vertex is less than 
> -1000000.But the value I want is (1300,500,0). 


7M-5M = 2M, thus the -1M would roughly be at the viewers side of the surface in 
earth coodinates. 

Thus is reads like the text node was parented to your earth node, not directly 
to world.

Cheers,
S

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to