automate a plane to look at camera

esnho's icon

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"

Max Patch
Copy patch and select New From Clipboard in Max.

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

4745.flare.png
png
esnho's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

For dumbs like me:

joumik's icon

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 ?

esnho's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

that object come from here:
http://www.jasch.ch/dl/

joumik's icon

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)

joumik's icon

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

joumik's icon

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 ...