questions about vsg

73 views
Skip to first unread message

nj pjy

unread,
Nov 23, 2022, 7:09:22 AM11/23/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hello!
I am a beginning student using vsg.My problem is as follows:
I have a point in wgs84 coordinate system. I want to add this point in the scene created by vsg, for example add a small ball on that point. This scene is composed of osgb data, but I don't know what coordinate system vsg uses and I don't know how to convert.
scene.png
When I click on the scene, the following coordinates appear
坐标.png
Can you give me some help, thank you very much!


Robert Osfield

unread,
Nov 23, 2022, 12:04:52 PM11/23/22
to vsg-...@googlegroups.com
Hi Nj?

The VSG and OSG uses the same conventions for default coordinate frames for loaders : +ve X to right/east, +ve Y ahead/north and +ve Z up,  and both an EllpsoidModel class that can help to/from ECEF and Lat/Long/Altitude.

However, your models can be set anyway you want, you need the default coordinate frames that the loaders assume.

It's difficult to know what you actually need to do as you haven't provided much details about your dataset or what you've tried so far.

How was your .osgb file created?  What coordinate frame does it use?

Writing a file out to ascii i.e. osgt or .vsgt can be helpful if you want to see how the scene graph is strucurtred, what the values the vertex data has, what transform there above the geometry data.

The vsgintersection example has support for intersecting the model and then inserting a geometry shape at that point.  Try loading your model and then pressing 's', 'b' or 'p' for sphere, box and capsule respectively.

Cheers,
Robert.

nj pjy

unread,
Nov 24, 2022, 3:55:33 AM11/24/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hi robert,thank you for your answer!
I checked the metadata file of osgb,as follows:
metadata.png
I also converted an osgb file to vsgt. Please have a look.
What I'm doing now is to use this point to create a box in my scene through createBox. How can I convert this point to the world coordinates of vsg?
光心.png
Cheers!
Tile_-034_+002.vsgt

Robert Osfield

unread,
Nov 24, 2022, 4:16:16 AM11/24/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hi ?

On Thursday, 24 November 2022 at 08:55:33 UTC njpj...@gmail.com wrote:
Hi robert,thank you for your answer!
I checked the metadata file of osgb,as follows:
metadata.png

None of the OSG native formats have meta data like this, they aren't even XML.  This exert must come from another source.
 
I also converted an osgb file to vsgt. Please have a look.
What I'm doing now is to use this point to create a box in my scene through createBox. How can I convert this point to the world coordinates of vsg?

The concept or "world"., "model" and "local" coordinates are all a bit flexible with scene graphs like the OpenSceneGraph and VulkanSceneGraph,  essentially the transform nodes placed in the scene graph hierarchy create a series of local coordinate frame nested within the parents coordinate frame,  The concept of "world" and "model" coordinate frames might be treated the same but this is a convention that different development teams may have, it's not something dictated to you by the scene graphs.

If you scene graph has no transform nodes that all the geometry will effectively be in a "world" coordinate frame, if you have just a single transform above your geometry then the local subgraph will be "object" coordinate frame, and the transform above it will place it in the "world" coordinate frame.

I say this all loosely though, some users might be working on visualizing molecules others planetary systems, the scene graphs don't care or dictate what transforms you use or what convention you wish to apply to them.  It's the application that decide the meaning of the different coordinate frames.

The .vsgt file you provided looks to be from a .osgb paged database, but isn't a complete conversion as it still refers to .osgb children.  vsgconv has support for converting paged databases so you can do the whole lot if you want.  Once you've figured everything out it'll be best to convert to .vsgb rather than .vsgt as it'll be smaller and much faster for loading.

The .vsgt has one geometry tile (the VertexIndexDraw node) but it's not decorated by a transform so essentially the data is all in the same coordinate frame. VirtualPlantetBuilder will decorate the tiles with a MatrixTransform to place it from "local" into "world" coordinate frame, but as it's not there I can only presume that the paged database was created by another tool.

 So how was this data created?

How familiar are you with the OSG?

Cheers,
Robert.
Reply all
Reply to author
Forward
0 new messages