Replies: 3 comments 2 replies
-
Hi Bruce,
You're probably looking for the LineSegmentIntersector. Look
at examples/traversals/vsgintersection/
Cheers,
Roland
…On Tue, 15 Nov 2022 at 09:09, bclay1297 ***@***.***> wrote:
Is there a way to pick / identify nodes like there is with osgPick example?
Bruce
—
Reply to this email directly, view it on GitHub
<#581>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQ6RRGKRYSJDQ5FWW2LWIK2DFANCNFSM6AAAAAASAJFJJ4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi Bruce,
I haven't looked at the example for a while and don't recall what is
available built-in.
I have a similar need. In my case, I'm generating geometry in real time to
represent various data and the most efficient way I've found is to derive
my own class from LineSegmentIntersector so that I can
calculate intersections rather than rely on testing for intersections with
the underlying geometry. The actual intersection testing is done by a
custom ConstVisitor handler in each object class. Depending on your need,
you might only need the ConstVisitor handler. I might be over-complicating
it, but it achieves the result and you can optimise intersection testing if
you need to do it continuously (ie when moving mouse). It's a work in
progress.
Hope that helps,
Roland
void VisNodeDrillDisc::accept(vsg::ConstVisitor& visitor) const
{
if (auto v = dynamic_cast<LineIntersector*>(&visitor))
{
..... do your testing here
auto dpt = vsg::dvec3((double)pt.x, (double)pt.y, (double)pt.z);
auto is = v->add(dpt, 0.0, {}, 0); <--- built in intersection
vector
is->setValue("layer", myLayer)); <--- your custom intersection
information
is->setValue("id", myId); <--- your custom intersection
information
}
else
{
traverse(visitor);
}
…On Tue, 15 Nov 2022 at 11:27, bclay1297 ***@***.***> wrote:
Roland:
Thanks for your reply. I see a lot of data in that app when I click on the
model but I do not see any identifiers to say which model or what part of
(articulation part) a model was selected. i.e. no node name or node id. Am
I missing something?
Bruce
—
Reply to this email directly, view it on GitHub
<#581 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPOEQ3E6Z3R74OGONAEUVTWILKHPANCNFSM6AAAAAASAJFJJ4>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi Bruce,
On Tue, 15 Nov 2022 at 00:27, bclay1297 ***@***.***> wrote:
Thanks for your reply. I see a lot of data in that app when I click on the
model but I do not see any identifiers to say which model or what part of
(articulation part) a model was selected. i.e. no node name or node id. Am
I missing something?
The LineSegmentIntersector::Intersector structure that is returned for each
hit has a nodePath member:
https://github.com/vsg-dev/VulkanSceneGraph/blob/master/include/vsg/utils/LineSegmentIntersector.h#L48
… Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to pick / identify nodes like there is with osgPick example?
Bruce
Beta Was this translation helpful? Give feedback.
All reactions