View unanswered posts | View active topics It is currently Sun Jun 16, 2024 6:38 am



Reply to topic  [ 3 posts ] 
 Surface normal, and realistic reflections !!Images!! 
Author Message
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Surface normal, and realistic reflections !!Images!!
I noticed particles don't reflect right, that is, according to the law of reflection:

Image

So, it shall be fixed!

Image

The dotted lines are the surface normal estimations, fire puffs the hitposition of the first raycast.

Pastebin of functional part for your convenience: http://pastebin.com/nP8Yt8R5

How the surface normal is estimated:
Image
And how the reflection angle from original is calculated to be used by Vector:RadRotate()
Image
Actually, it would be 90-alpha, but in radians 180 is conveniently Pi.


Because all the actors in Cortex Command are meth addicts and shake all the time, this isn't that good for beams.
The constant jittering means it'll spread all over the place.
Projectiles however, should do well.

Feel free to use this for anything you want to bounce around.


Attachments:
File comment: Proof of concept
Reflection.rte.zip [1.09 KiB]
Downloaded 312 times


Last edited by findude on Sun Oct 24, 2010 4:42 pm, edited 1 time in total.

Sun Oct 17, 2010 12:51 pm
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Surface normal, and realistic reflections !!Images!!
Nope, try commenting out the script from the beam, and shoot it at a straight, vertical wall on an angle.

The angle of reflection is the same as angle of incidence, but it is measured from the normal, not the face itself.

It's wrong.


Sun Oct 17, 2010 11:04 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Surface normal, and realistic reflections !!Images!!
Makes you wonder just what bastardized math data is actually using.


Mon Oct 18, 2010 3:02 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.082s | 18 Queries | GZIP : Off ]