Real time bitmap input

Hello. I would like to use a grey-scale bitmap to manipulate some parameters. This is easy enough, but I want to do it live. It could be a video feed, or just reading the screen of a paint program.

I’m trying to create an interface for an artist so that they can “paint” the geometry of the model.

Any ideas, or previous discussions about this?

Depending on the requirements for “live”, it’s pretty trivial to dynamically read/update an image file feed using the native Import Image component. Here’s a quick example:


231025_MeshDisplacement_00.gh (9.3 KB)

2 Likes

Outstanding. That’s it. Thank you. So are you overwriting a referenced file, or is it more simultaneous than that?

1 Like

if you need surfaces instead of mesh, have a look at SurfaceRelief | Food4Rhino . Also comes with load bitmap component that checks if source image has been updated

Thank you.

I’m not yet 100% sure how I will deploy the data. It will be somewhat oblique. It’s not like I’m turning a photo into an object. It’s more like I’m trying to create a sandbox-like control mechanism for some other geometries. So, it’s like I just want the grey-scale values to control local point coordinates that influence something else. Surface or mesh may or may not matter. I don’t know. I’ll definitely check this out.

Thanks again.

Yup, in this example I’m simply saving the image in Gimp, which triggers the Import Image component to automatically re-read the file from disk when the Synchronise option is enabled:

Which is also why the whole setup is a bit laggy. For more responsive real-time interaction you’d probably have to set/get the image information in a memory stream or something similar.

You could use the native Surface from Points component (if one does not want to use a licensed plugin).

2 Likes

is there a way to use image sampler instead of construct mesh Component ?

I’m assuming you tap Ctrl+E to export the image file?

Mission accomplished! Thank you!

It’s not beautiful yet, but this is only step 1. Big step, though. Cheers!

1 Like

I can’t actually recall, but yes I think that’s what I did (I only use Gimp on my personal laptop :face_with_open_eyes_and_hand_over_mouth:).

It looks like the Image Sampler has an auto update feature as well:

Glad it helped :slight_smile:

1 Like