[x3d-public] Display a reference coordinate system at the bottom left of my view
Hans Moritz Guenther
hgunther at mit.edu
Wed Jun 12 10:32:25 PDT 2024
I'm trying to put a reference coordinate system (x, y, z) arrows onto my
scene, such that they are always visible at e.g. the bottom left corner.
I found
https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/CoordinateAxesX3dDISIndex.html
which makes the x,y,z arrows and then it promises "See
CoordinateAxesExample for use as an Inline coordinate-system reference
frame.". That seems to be pretty close to what I'm looking for.
Unfortunately, I can't locate the CoordinateAxis example; it's not in
the list of examples for this chapter
(https://www.web3d.org/x3d/content/examples/Basic/DistributedInteractiveSimulation/index.html).
Can you point me to that example or a different setup that might give me
what I need?
The closest I've found is the ViewFrustrum example, as in "features get
moved relative to the viewpoint" but in that case, the coordinates of
the lines are re-calculated at every step, while my case seems simpler
and I'm hoping that it can done with just ROUTE to set the origin of a
TRANSFORM node, which contains the x,y,z arrows, relative to the
viewpoint coordinates. However, I've not been able to figure that out
yet - maybe I'm not connecting to the right properties (see code example
below). I see the arrow, but it's not moving when I'm moving the camera,
so it's going out of view when I look elsewhere. Instead, I would have
expected it to always sit right on top of the camera. (In the end, I
obviously want it to be at some constant distance from the camera, but
if I can't figure out how to connect the location of the arrow to the
location of the camera at all, then I don't have to worry about those
details yet.)
Thanks for any advice,
Moritz
<Transformtranslation='-2 0 0'DEF="arrow">
<CollisionDEF='DoNotCollideWithVisualizationWidget'>
<Group>
<!-- Vertical Y arrow and label -->
<GroupDEF='ArrowGreen'>
<Shape>
<AppearanceDEF='Green'>
<MaterialdiffuseColor='0 1 0'></material>
</Appearance>
<CylinderDEF='ArrowCylinder'radius='.025'top='false'/>
</Shape>
<Transformtranslation='0 1 0'>
<Shape>
<ConeDEF='ArrowCone'bottomRadius='.05'height='.1'/>
<AppearanceUSE='Green'/>
</Shape>
</Transform>
</Group>
</Group>
</Collision>
</Transform>
<Viewpointdescription='Overview'orientation='0 1 0
3.141592653589793'position='5 5 0'
viewAll='true'DEF='viewall'/>
<ROUTEfromNode='viewall'fromField='position'toNode='arrow'toField='translation'/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240612/e0017df0/attachment.html>
More information about the x3d-public
mailing list