Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Does anyone know how to emulate a shadow

Author
Message
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 18th Jun 2005 20:41
How do I get a shadow to "curve" around a hole?

please reply
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Jun 2005 07:22
It depends on where the light is coming from. Or do you mean something else? Please post some more details like if you want to work with 2D or 3D.

Attachments

Login to view attachments
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 19th Jun 2005 20:04
I wan't to create a shadow in a 3d world, by putting a dark image on the floor. The positioning isn't going to be a problem, I'm puzzeld about how to "curve" the shadow on a hill or hole

please reply
Drew Cameron
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 20th Jun 2005 07:11
Is the world built out of Matrices or Objects?

Dumbo and Cool

WIP Board!
w2up
19
Years of Service
User Offline
Joined: 19th Jun 2005
Location:
Posted: 20th Jun 2005 10:23
the simplest way is to use a decal (3D Plain) and ghost it,
place it over/under where the shadow is desired.

Basically, use MSPaint,
make a "black texture" about 64x64 (0-63,0-63)
and then make a dark circle (color 3,3,3) in the center.
Make the circle as big as possible.

Then use this image as your decal texture. For use for people,
you can even stretch it to make it oval if needed.
Just ghost it, and make the black transparent.

This will take a very slight impact on performance, compared with
using true shadows ... The only other way is to use a "light-mapped"
texture ... that's a bit more work.

code ... the international laguage
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 21st Jun 2005 05:29
Okay, I'm floating too much around topic aren't I

I wan't to use it for a 3d race track editor (a cros between re-volt and trackmania). And I'm going to use mostly square objects. All the pieces are dynamic so a lightmap isn't a good idea.

I know useing a plain is a good Idea but what, if I create a hill, how do I round the shadow up the curve of the hill?

please reply
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 21st Jun 2005 11:59
well, if the shadow is under a car ... just put it there ..
Also, if you want the shadow moving smoothly over a hill top,
that's hard. You'll need an extra dummy object, and attach the shadow as a limb. Then, use trig to determine the pitch/roll
of the terrain under the shadow and rotate the shadow limb as needed. The code is hard to write the first time, after that, you can save it in an archive as a refrence ....


That code will not work as written because:
1 - source is in DarkEdit
2 - Calls external math functions
3 - Uses external defined constants ... _CAY ...
and so on.
This is just to show the math used.
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 22nd Jun 2005 03:36
There's a tilt code in the binarymoon tutorials, I always use that one for titling.

please reply
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 27th Jun 2005 21:48
If you can use Dll's then try sparky's. It allows you to use the intersect object command, this command calcualtes a line between two points and tells you if it hits something, you can find the object number, collision position and normal vector...you position the shadow at the collision position and then point object to the (collision position+normal vector)
Hope that helps...and isnt too deep !

Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 28th Jun 2005 06:31
NEVER EVER GO TO ME TALKING ABOUT DLL's!!!!111!1!1!!!11
haha, just kidding , we stil cool right? right?

I don't have DBC enhanced, so I can't use Dll's >_>;
But, I don't have anny problems with the positioning of the shadow, What I need is someone to explain to me how to create (an extra?)dummy object and how to and attach the shadow as a limb.

please reply
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 28th Jun 2005 09:11
Quote: "we stil cool right? right?"

Of course !

Quote: "What I need is someone to explain to me how to create (an extra?)dummy object and how to and attach the shadow as a limb."

Well im not sure if there have been changes from db to dbp so i'll leave this one to the DBC pros.
Seeya

waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 10th Jul 2005 14:33
examine the room demo ... the one with the scorpion ...
it just uses the same model, some limbs deleted, textured black
placed below the real object. As they are both playing animations at the same time, the shadow looks believable.
Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 11th Jul 2005 04:57
I stil don't understand it, you know. If my car is half way on a slope for instance (front wheels over the edge and the back wheels infront) how do I get the shadow to "bend" around the edge.

please reply

Your signature has been erased by a mod because he was in the mood for it
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 12th Jul 2005 00:19
Well, it is imposible... You cannot manipulate objects in DBC. Leave the shadow. When you decide to make plains for your shadow, you will see you will never have enought plains and when u texture the matrix under the object, you will see you cannot scroll the texture.

Immunity and Annihalation makes Immunihalation...
Drew Cameron
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 12th Jul 2005 00:52
Quote: "I stil don't understand it, you know. If my car is half way on a slope for instance (front wheels over the edge and the back wheels infront) how do I get the shadow to "bend" around the edge.
"


There is nothing you can do, literally, to stop that in DBC. Sorry.

Login to post a reply

Server time is: 2025-05-23 07:01:22
Your offset time is: 2025-05-23 07:01:22