Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to highlight intersection between objects?

Discussion in 'AR/VR (XR) Discussion' started by jsatlher, Nov 28, 2019.

  1. jsatlher

    jsatlher

    Joined:
    Aug 15, 2018
    Posts:
    4
    Hello, I'm new to Unity and I'm developing an augmented reality app.

    My situation is as follows: I have two objects in the scene, a neighborhood model and a cube. The mockup will be the object I am going to enlarge and the cube will be like the acrylic box where the mockup is. The cube represents the viewing area and will be transparent. The model has an animation in which it moves and scales and the cube remains fixed.

    I need something to assign to the cube so that when expanding the model, the parts that stick out of the cube will have 50% colorless transparency (all gray) and the part of the model inside the cube (in intersection) remains transparent and with the colors and textures.

    The idea is to present the mockup on an initial scale that is inside the cube (acrylic box) then the model's animation will zoom in on the mockup at certain points, the whole mockup will be much larger than the cube. the outside of the cube is transparent and colorless, and the inside remains uncolored and colored to give more prominence to what it is showing.

    Can someone help me?
     
  2. satchell

    satchell

    Joined:
    Jul 2, 2014
    Posts:
    107
    Not entirely suited to your exact needs but this should help.

    Though intended for the minimap the Off Screen Target script could be modified to fit your need. More of a hobby for me but I did my best to explain square routes of Vector3's in this blog post.