Skip to content

Example: Label appering on the given distance from object to camera#415

Open
NataliaDSmirnova wants to merge 1 commit intojscastro76:masterfrom
NataliaDSmirnova:distance-label-example
Open

Example: Label appering on the given distance from object to camera#415
NataliaDSmirnova wants to merge 1 commit intojscastro76:masterfrom
NataliaDSmirnova:distance-label-example

Conversation

@NataliaDSmirnova
Copy link
Copy Markdown

@NataliaDSmirnova NataliaDSmirnova commented Dec 3, 2023

The example shows a way to add custom labels. It presents how distance from camera to threebox object can be calculated using threejs math.

Note: distance is in world units (not meters).

Additional elements:

  • threejs stats measuring performance
  • threejs GUI control changing distance threshold
  • element showing the current distance from the camera to the red cube

Main functions:

  • createLabel()
  • updateLabel()

The example is a result of a conversation here: #409

image

@NataliaDSmirnova
Copy link
Copy Markdown
Author

@jscastro76, could you add any comments? I'd be grateful 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant