Jump to content

Point Normal to look at Camera


Recommended Posts

Hi guys, this is my first post, great forum!

1) Basically I am in need to get points normal to always face a camera (specified: cam1, cam2, etc). Is there node or script to do such thing? Expression, maybe?

2) After I get the normal to face camera, I am also thinking to rotate each one of the facing point to rotate randomly.

Please give me some guidance or hints.

Thanks!

- enzym

Link to comment
Share on other sites

Hi enzym,

here i have made your point normal facing towards camera.

and i tried random rotaion, but for some reason the random rotation is not working.

didn't spend that much time for random rotation, i am sure you can make the random roation work.

sorry for random rotation bcoz i have to work for my crappy essay as an university assignment.

Cheers

Junaid

point_normals.hip

Link to comment
Share on other sites

Hi Junaid,

Thanks! It works great.

One note, I saw there is a yellow border around Point SOP though, it gives a little warning saying "the two sources have unmatched geometry. What causes this? Is this ok? Do you think Facet SOP will help?

I like this `hack`, sort of what I had something like this in mind but didn't think of using object merge (clever!).

Do you think there is another way? But I will use this for now, thanks again!

- Jim

Link to comment
Share on other sites

Hi Junaid, just to add on `why random rotation does not work`; that is because you use $CY in random function expression. It is not a $CY, but $PT because you are not using `copies`, but you use `points` from template object. There is only 1 copy by default :) I am sure you know this too.

Also, with the warning message, I think to keep clean, we probably gotta delete some unnecessary attribute/values. Sometimes I see this `vertex` and `points`both available at the same time.

Thanks again for this normal transfer hack!

* If I found another way I will let you know or maybe someone here can add some info? If using particle, from documentation, there is already attribute to do so.

- Jim

Link to comment
Share on other sites

Hi enzym,

yeah i am sure particle will have geater control, but again the questions is what exactly you want to create.

yeah let me know if you find some other way and about random rotaion it should be posible through stamp funtion i guess.

Cheers,

Junaid.

Link to comment
Share on other sites

  • 10 years later...

Hi, based on import camera vector to the add node, you can use wrangle with a few strokes 

First input - your points, second - add node.

vector cam = point(1, "P", 0);

@N = cam - @P;
@N = normalize(@N);


Regards, 
Aleksandr.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...