View unanswered posts | View active topics It is currently Sat Sep 21, 2019 10:21 am



Reply to topic  [ 4 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 126 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
Data Realms SUPER Elite
Data Realms SUPER Elite

Joined: Thu Jun 03, 2010 10:06 pm
Posts: 3717
Location: Over there.
Reply with quote
Post Re: Surface normal, and realistic reflections !!Images!!
findude wrote:
Because all the actors in Cortex Command are meth addicts and shake all the time, this isn't that good for beams.


True.

I have always assumed that particles don't follow the rules of reflection because when using pixels, everything is sort of square, so I don't think of reflections as:
Attachment:
Reflect.png
Reflect.png [ 8.81 KiB | Viewed 2103 times ]


But as:

Attachment:
Reflect2.png
Reflect2.png [ 4.85 KiB | Viewed 2103 times ]


So the rules of reflection are correct, but look wrong.

The drawings aren't necessarily accurate.


Sun Oct 17, 2010 8:18 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   [ 4 posts ] 

Who is online

Users browsing this forum: Google [Bot]


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.022s | 16 Queries | GZIP : Off ]