System and methods for performing surgery at a target site defined by a virtual object. A surgical navigation system includes a patient tracker to be attached to a patient. A localizer cooperates with the patient tracker and generates localizer data associated with the target site during the surgery. The surgical navigation system also includes a vision device to generate image data associated with the target site and surfaces surrounding the target site. A navigation computer in communication with the localizer and the vision device is configured to determine a region to be avoided outside of the target site based on the localizer data and the image data. In some cases, a second virtual object is generated to define the region to be avoided so that a surgical instrument used during the surgery avoids the region.