Forums > Jitter

automate a plane to look at camera

December 11, 2012 | 12:12 am

Hi, maybe this is a dumb question but I'm trigonometry ignorant and I've got a problem:
I'd like to make some planes automatically oriented to the camera, as you can see from the patch I use two textured planes to make some flare light effect, now, if I move the camera the trick becomes evident, so I thought that if I make the planes always oriented to the camera the trick is still efficient. Can you put me on the right way to do this?
It takes a lot to me make those light travel on a sphere path like and I really don't know where to start to make them always oriented to the camera.
In attached you can find the png file for the "flare effect"

Sorry for my bad English and thanks a lot for your attention.

– Pasted Max Patch, click to expand. –

[attachment=210253,4745]

Attachments:
  1. flare.png

December 11, 2012 | 1:24 pm

As my simple implementation the answer is pretty easy, is enough get the camera quaternion and set it to the flare plane!

It would be nice to implement also the translation transformation to those quaternion but… for now is ok, if someone wants to teach me how to do it is welcome.

For dumbs like me:

– Pasted Max Patch, click to expand. –

January 6, 2013 | 12:07 pm

hi ,
i’m also interested in your question .
but when i’m loading your patch , the "pi_constant" box is missing my path ("No Such Object" in MaxWindow)
did you get it from a particular place ?


January 6, 2013 | 2:10 pm

ops!
sorry, here is the patch without the object pi_constant

– Pasted Max Patch, click to expand. –

that object come from here:

http://www.jasch.ch/dl/


January 6, 2013 | 11:58 pm

ok
i should ‘ve tried the 3.14 …

maybe you could use a sphere instead of a plane , and find the good shader .
the "mat.phong.glsl.jxs " one , present in Max6/Cyclin’74/Jitter Shaders/Material
seems to do the job quite well (setting the param "la" to -0.4 , then tweak the rest )
maybe you’ll find it good .
you wouldn’t have to care for the planes’ orientation anymore .

maybe you really neeeed to use a plane …

no more idea …

good night (from here)


January 7, 2013 | 12:02 am

not only the "la" parameter is important …
the others too
hope you’ll find the good settings…


January 7, 2013 | 5:04 pm

something else , even simpler ,
the fog param to the gridshape , the last from the list …

i’m still talking about something completely different from the initial question ,
sorry …


Viewing 7 posts - 1 through 7 (of 7 total)