User Tag List

Results 1 to 2 of 2

Thread: Dynamic line of sight?

  1. #1
    No Products Registered

    Join Date
    Jun 2020
    1 Post(s)
    0 Thread(s)

    Dynamic line of sight?

    I'm pondering on the best approach for a "dynamic" line of sight for the player character. My idea is like this: Topview, the player has an invisible cone infront of him, anything in that cone becomes visible, anything outside becomes black.

    I could do a layering effect with static images, but I need it to be dynamic in the sense that the line of sight cone can be blocked so the player can't see through walls.

    Any ideas?

  2. #2
    Clickteam Clickteam
    Simon's Avatar
    Join Date
    Jun 2006
    65 Post(s)
    3 Thread(s)
    Hi there,

    what you are talking about is loosely termed ray tracing... In your case, plotting the path from the player object to see whether it hits an object early or whether it is able to travel the full distance of the torch path. There are lots of ways to achieve that, from firing an invisible object out repeatedly until it hits something, to creating a series of concentric lines like you'd get in a wifi signal indicator:

    If one of these objects overlaps a wall or similar, you could determine this was the farthest object which should be shown. You could split each line into multiple segments to make this more detailed. You could also take a masking approach, depending on what you're doing, using shaders or objects with holes in to mask out everything except the area under the "torch" light beam. I've attached an example I made of this effect: Multiple torches on dark background.mfa

Similar Threads

  1. Line of Sight example
    By Ryan in forum File Archive
    Replies: 4
    Last Post: 30th August 2010, 06:27 AM
  2. Line of Sight
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 29th August 2010, 12:36 PM
  3. Line of sight
    By Beginier in forum File Archive
    Replies: 4
    Last Post: 24th June 2009, 06:40 PM
  4. Line of sight
    By Beginier in forum File Archive
    Replies: 5
    Last Post: 23rd June 2009, 04:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts