## automate a plane to look at camera

Dec 11, 2012 at 12:12am

# automate a plane to look at camera

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:
#65624
Dec 11, 2012 at 1:24pm

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. –
#236410
Jan 6, 2013 at 12:07pm

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 ?

#236411
Jan 6, 2013 at 2:10pm

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/

#236412
Jan 6, 2013 at 11:58pm

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)

#236413
Jan 7, 2013 at 12:02am

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

#236414
Jan 7, 2013 at 5:04pm

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 …

#236415

You must be logged in to reply to this topic.