Jump to content

Indicator arrows in screen space


tbgeorge
 Share

Recommended Posts

Hi all,

I want to get some indicator arrows on the screen pointing to the location of different meshes when you're not looking at them. For example, there is a box in the world and when the camera is looking at it, there is nothing else on screen, but as soon as the box is off-screen, an arrow shows up on the edge of the screen, pointing me in the direction I need to rotate the camera so that the box is on screen again. 

I've figured out how to get different meshes screen position based off of their world positions, but I have no idea how I would draw the indicator arrows... 

Any help is greatly appreciated.

Link to comment
Share on other sites

1 minute ago, jerome said:

Yeah, I figured it would have to be a plane parented to the camera set to look at the specific mesh, but how would I go about positioning it on the edge of the screen?

My initial thought was to have an invisible plane, directly in front of the camera that I can use to convert screen coordinates back into world coordinates, and place my arrow mesh at that location. 

I'm going to try that in a playground and post it back here.

Link to comment
Share on other sites

@jerome always has a good answer. And you might also use a canvas object with a seperate camera so you don't require any other testing or manipulation. Check out CastorGUI, bGUI, and the Dialogue extension for quickly creating the display arrows as canvas objects, as there are many advantages to this. and you should be able to query if an object is within the scene canvas. 

And for checking an objects position in the display, you can always do this by measuring the deltas between camera and object transforms - but I assume you already know this.

Welcome to the forum.

DB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...