- Home /
Creating dynamically sized projectors
I am looking to use projectors to create area of affect indicators for various attacks. I have many different attacks of different sizes, shapes and aspect ratios.
I would like the ability to create a filled trapezium shaped projector of any dimension with a rounded front (imagine the silhouette of a cupcake). Ideally this would also be outlined by a thicker border.
I know that many other MOBA type games use projector like systems to accomplish this task.
My question here is what would be the best approach to solve my problem. I have considered drawing many shapes of different aspect ratios and controlling their size, however this involves more artwork than you would want to do ideally.
There is also the aggregate solution where you use a projector for each line in the shape. This would give you dynamic sizes I think, but I don't know how to fill the inside other than to attempt to progammatically generate a texture which seems tricky for this kind of shape.
I have seen mention of changing the angle of the camera to modify the area of the view frustrum that hits the ground and thus modify the size of the projected texture. If someone could elaborate on this approach I would appreciate it.
My final idea, not sure if it is possible or not, was to modify the matrices of the camera to distort the view frustrum into the desired trapezium shape and use a plain square projector texture.
Which, if any, of these ideas would be the way to go? How is it done for real?