How do I get Light and shadow effect in 3D

0 favourites
  • 7 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • I am trying to get a light and shadow effect in 3D ( something similar to shadows using Paster plugin like in this post ...) .

    Please see the image of what I am trying to achieve...

    As you could see from the image, the light source lits up the object in the middle ( please visualize this as a 3D system). Now when I move the light source around the middle object, the lighted / shadow part of the middle object should change accordingly in this view. May be something to do with textured quads using R0J0hound 's Paster plugin ? May be R0J0hound or could help as to how I can go about doing this? Though I have purchased Q3D plugin, at the moment it looks tough for me to accomplish the same using Q3D plugin...If someone has ideas as to how this can be done using Q3D plugin, please let me know...I have done this pretty easily in blender3D tool...Thanks.

  • For that you could make a semicircle sprite as in the image and set it's angle to the light?

  • Thanks very much I used that technique earlier. The way I did was - Have 2 semicircle sprites (one dark and another one for lighted portion) and accordingly scale the widths of the semicircle sprites depending on the angle of the light source. I hope this is what you meant. This works but the effect wasn't all that realistic. If you meant a different approach then please let me know.

    I was wondering if using one of the approaches below might give it a more realistic effect -

    1. Use C2 inbuilt shadow caster/Shadow light behavior OR

    2. Paster plugin and textured quads

    3. Q3D plugin

  • Q3D would give the most realistic results by far since you wouldn't be faking it.

    Textured quads with paster is an interesting idea but it will likely be more complicated than q3d since you have to define all the verticie positions of the sphere, calculate the shading of each face, and zsort the faces so it draws right.

    The shadow caster behavior isn't really useful for shading as its for casting 2d shadows.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • https://dl.dropboxusercontent.com/u/829 ... %20cap.png

    I made a small example for you. I'm not sure if you'll be able to get it to work cause i used a new version of the Q3D plugin which i've been working on (whoops) so i made a screenshot just in case. It should run though since this component of the plugin wasn't heavily modified. you might get a warning about versions or whatever.

    https://dl.dropboxusercontent.com/u/829 ... ample.capx

  • Thanks R0J0hound for making it clear to me.

    , That is perfect! It works with the previous version of the plugin as well. I will see if I can add the ability to move the light source by touch rather than auto revolution. Great! thank you.

  • kmsravindra

    No problem! thanks for buying Q3D, the new updates should be a bit easier to use

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)