Implementing drawing on a flat surface of a 3D object (looking for advice)

I am looking into implementing a drawing mechanic for a first person game. The mechanic will be that the player will bring a piece of paper, parchment, clipboard, etc. in front of them so that it stays within the camera forward view when looking around. I have that part done.

Now I am looking into being able to use the mouse cursor (and probably a player model hand in the future) that draws on the 3D object by holding click. Any lines drawn will be retained on the object. The player will only be drawing on FLAT surfaces of 3d objects so no need for drawing on curved surfaces. I have seen several videos showing that the Line Renderer can be used to implement drawing, but it is all done on the UI layer so I’m wondering if this can be done on an object model too?

Then after the drawing is complete, I would like to take the drawn lines and compare them to existing symbols that I already have in a collection. It should find the closest match to the drawn lines and spit out a percentage match to check for a minimum confidence value. I figure that I can use one or two specific pixel colors when drawing so that I can pull those specific colors out and match those pixels against the existing collection.

So to summarize, I’m wondering if there are any best practices or paths that I should pursue in order to:

  1. Draw on an object held in front of the player
  2. Pull that drawing from the object so that it can be compared against a collection of drawings
  3. Actually implement the comparison algorithm (this one is less important for now since I imagine I will have to deep dive on different algorithms for this one).

Thank you in advance! I am thinking of posting this in Scripting as well. I don’t want to spam but also Scripting might be more appropriate for this? Not sure.

One thing is for sure, ive never seen this in a game, and this will have to be a custom system that you or someone else can program/code. Saw this post the other day, and have been thinking of ways to impliment it.

  1. Draw on an object: can only be done by particle effects/UI/animation.
  2. Pull the drawing from the object: make it easier by holding a scroll/paper (the object) up to the player, instead of paper on another object.
  3. Comparison Algorithm: not a problem to impliment.

Set up detection for when you walk up to the player, then use animation/particle effect for the drawing effect on the paper (object), Dont know what type of game it is, but this paper/object would have to be a pick-up item (you give it to the player, you get it back).

Never tried anything like this, but best of luck brother :slight_smile:

1 Like

Thank you btw! I have made strides on this more quickly than I anticipated thanks to help from awesome members of the Unity forums. I’m pretty excited that I got stuff working! Eventually I should post in the area to show off work and such.

1 Like