How do I draw shadows into a surface

Can shadows in Sketchup be captured programmatically? For example, drawing a shadow at a moment into a surface.Thank you!

You recently asked a similar or same question:

Looks like:

  1. You do not like or just ignored the answer you already got.
  2. we - at least I - don’t understand what you want to achieve.
    Can you please explain in other words? I mean not one more word but several more… :wink:

You can check this:
Class: Sketchup::ShadowInfo

1 Like

It’s already been done…
https://sketchucation.com/pluginstore?pln=TIG_shadowProjector
The files are all RB so you can read them to see how it’s done.
However, I did make it © and ‘All rights reserved’…
So don’t copy blocks of my code en masse - but you’re welcome to borrow some ideas…

In case what you really wanted was to have a shadow burned into the texture, that may be a bit harder to do with Ruby, but is easy to do with the built in features. See the attached SKP and this screenshot:

To get the effect I took a screenshot of the rectangle from above, then made a unique duplicate of Sumele, set it to not cast shadows, and made the second rectangle texture be unique. I replaced the material in the second rectangle with the screenshot.

Here’s the SKP:

burnedinshadow.skp (3.2 MB)

1 Like

Tig, thank you for recommending your plug-in. It is really nice, but I encountered a little difficulty in the operation. I can’t draw shadows on a flat surface. I can only draw on a three-dimensional surface at the moment. , Is there a problem with my operation? Below is the video of my operation

You inadvertently loaded an audio-file… not a video clip !
Anyway… my ShadowProjector will project a shadow ‘outline’ onto a flat surface [or any other suitable surfaces] but not onto the ‘ground’ plane unless there’s a face there - so do you have a face draw at z=0 ??

The video does work. His initial rectangle had the reverse face upwards, might that matter?

For me his clip doesn’t load as a video on Firefox or Chrome or Edge.
What’s your browser ?
How did you ‘view’ it ?
Did you download it first ??

It assumes shadows are cast onto ‘front faces’ - so if he has a face-plane at z=0 it probably needs reversing to see/show a shadow outline - because SketchUp always draws that kind of face looking down !?

It does seem to be a blank video in most browsers. I was using Safari.

Yes, strange how SketchUp draws ground planes facing downwards.

It’s odd that PC based browsers seem to choke on this clip…

It’s logical to draw a face that’s flat at z=0 facing downwards, because the user is expected to want to PushPull extrude it upwards and then the ‘seed’ face is the correct orientation…
The ‘winding’ of the edges forming a face that is not flat at z=0 determine its face’s normal [ccw etc], this happens manually and in code.
Authors of code have had to trap for this foible and reverse such faces if necessary - but as in this case manual users can be tripped up by it…

Thank you for your patient reply. It is my own negligence. I forgot that the face is facing downwards.This plugin is great.That video is working for me, maybe there’s a problem with uploading it, but it’s not important anymore

Thank you for your patient reply. It is my own negligence. I forgot that the face is facing downwards.

In the last question, someone has given me the correct answer, the plugin shadowProjector of TIG, but due to my ignorance and lack of description of the answer, I missed this plugin, thank you for your quick answer