[x3d-public] Display a reference coordinate system at the bottom left of my view
GPU Group
gpugroup at gmail.com
Wed Jun 12 11:07:09 PDT 2024
There's a ProximitySensor node (under 22 Environmental Sensor in the specs)
which can tell you where your ViewPoint is and what angle it is.
You can ROUTE translation from the ProximitySensor to a Transform that
wraps your coordinate axes. That will keep them positioned relative to the
viewpoint as you navigate (without rotating them - leaving them coordinate
system aligned)
-Doug
On Wed, Jun 12, 2024 at 11:33 AM Hans Moritz Guenther via x3d-public <
x3d-public at web3d.org> wrote:
> 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
> <Transform translation='-2 0 0' DEF="arrow">
> <Collision DEF='DoNotCollideWithVisualizationWidget'>
> <Group>
> <!-- Vertical Y arrow and label -->
> <Group DEF='ArrowGreen'>
> <Shape>
> <Appearance DEF='Green'>
> <Material diffuseColor='0 1 0'></material>
> </Appearance>
> <Cylinder DEF='ArrowCylinder' radius='.025' top='false' />
> </Shape>
> <Transform translation='0 1 0'>
> <Shape>
> <Cone DEF='ArrowCone' bottomRadius='.05' height='.1' />
> <Appearance USE='Green' />
> </Shape>
> </Transform>
> </Group>
> </Group>
> </Collision>
> </Transform>
> <Viewpoint description='Overview' orientation='0 1 0 3.141592653589793'
> position='5 5 0'
> viewAll='true' DEF='viewall' />
> <ROUTE fromNode='viewall' fromField='position' toNode='arrow' toField=
> 'translation' />
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240612/ab3a739f/attachment-0001.html>
More information about the x3d-public
mailing list