# Re: ICE trig maths, camera facing angles

71 views

### Andy Moorer

Mar 28, 2012, 12:53:46 PM3/28/12
to soft...@listproc.autodesk.com
You're looking for the dot product between the (normalized) vector pointing from particle to camera and the (normalized) vector perpendicular to the sprite.

If the sprite is facing the camera the scalar result will be 1. If it is 90-degrees to the camera the value becomes zero, and then goes to -1 when the sprite is facing away from the camera position.

On Tue, Mar 27, 2012 at 4:07 AM, Rob Chapman wrote:
Hi guys,

quick trigonometry question, unfortunately its never been my strong point so any advice would be much appreciated.,  Ive had a go at trying to get clouds as sprites working and getting improved results with each test, I'm finding that a direct sprite grid align to camera does not work  so well when the camera flies into or around the clouds but a randomised orientation does... but not when the angle is too extreme eg take a look at this test here http://vimeo.com/39255483  and the sprite grids that are too obtuse or acute really stand out. Iv'e had a go with an ICE tree that gives an angle between two vectors (the camera and the y axis of each particle) but don't seem to get the required results when show values is turned on. what I'd really like is that as the particle orientation approaches horizontal angle (to the camera) this gaves a scalar value/angle that I can then use to control the transparency , effectively fading it out at extreme angles or limit the orientation between certain values..   Anybody have an idea how to do this with ICE?  hopefully its simple.

cheers

Rob

### Andy Moorer

Mar 28, 2012, 12:55:09 PM3/28/12
to soft...@listproc.autodesk.com
Oops, looks like my reply was old news, never mind nothing to see here move along...

### pet...@skynet.be

Mar 28, 2012, 2:01:48 PM3/28/12
to soft...@listproc.autodesk.com
not at all.
I usually hack things around with some visual understanding of how things could/should work and a lot of trial and error – it can be helpful to see it spelled out like that.

### Chris Marshall

Mar 29, 2012, 10:12:24 AM3/29/12
to soft...@listproc.autodesk.com
I got to understand the cross-product because it involves sticking your fingers out at right angles, so you can actually see in front of you what you want and what you're going to get. Now that's the kind of maths my brain can cope with.

### Rob Chapman

Mar 30, 2012, 8:48:51 AM3/30/12
to soft...@listproc.autodesk.com
and since its Friday, here is a render test using this new 'incidence' mode on the sprites to fade the transparency.

cheers!

Rob