I was wondering if there is a way to use blender to project a grid unto a model and only keep the points that the projection collides with, basically I want to simulate a Time of flight sensor that emits a laser grid and receives the reflection of that laser which indicates the presense of an object and its distance, ideally slanted objects would reveive the laser but reflect it to a different direction and thus would not show up on the output of the sensor. Would this be doable using a python script? Anything that could set me on the right track would be appreciated.
Not a scripted solution, but you can achieve a similar effect using a particle system.
Create an emitter plane and a particle system. This will have all the particles emitted at frame
1.000 and a
lifetime long enough for the collision.
Set the emission to
grid and assign a velocity in the correct direction in the
Emitter object box. Leave all the other options to their defaults (
Newtonian physics with all the forces = 0) and in
Field weights remove the effect of Gravity by setting
gravity to 0.
Last, you would like to render the particles as lines. Select
Tail to zero and
Head to some value between 0 and 1. Use a high
trail count and set
Length as long as your particles lifetime. Also, tick
Length in frames.
Now, make sure that all the objects that you want to detect have a
Collision property (with default values).
(Now you can also add another plane - as a "sensor" - behind the emitter and make it collide with the particles that are coming back, killing them. Then you can render the dead particles as dots on the sensor)