the shady side

Posted By: Anonymous

the shady side - 02/15/10 18:11

Is there a fast way (no c_trace to the sun/lightsource) to check if a vector/entity
is within the shady side (e.g. stencil_shadow) of an object?


Posted By: KDuke

Re: the shady side - 02/15/10 18:25

How about baking predefined shadow volume objects? Like dynamically creating an entity which would have the size and form of the shadow volume. Then you could easily assign an action to the moving object with EVENT_ENTITY and could handle the stuff you want to happen if it is in the shady side. Though this won't really work well if you got a dynamic day/night system as the shadow-volume would change continously. Therefore it would be necessary to bake the shadow-volume entities over and over again resulting in the loss of speedgain.
Though otherwise you could have the engine handle everything.

Hope you get the idea X-D
Posted By: Superku

Re: the shady side - 02/15/10 22:27

Betrachte den Schattenbereich als zur z-Achse parallele Ebene, dann bestimmst du die kürzeste Distanz deines ausschlaggebenen Punktes (camera.x ?) zu dieser Ebene (Hessesche Normalform letzterer oder so, habe ich jahrelang nicht gemacht).
Ist diese Distanz kleiner als die halbe Objekt-Breite, ist schon einmal x/y im Schattenbereich und die z-Koordinate ist z.B. mit einer linearen Funktion zu bestimmen, die den Weg der Objekt-Spitze zum Grund angibt.
© 2024 lite-C Forums