x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Rotate Mesh To Face Camera

Hello, I am trying to create a materiel that will rotate a mesh only on the X axis to face the camera. I have found an example by Epic to do this on the Z axis but I cannot figure out how to convert to X (or Y). I cannot do this wilth blueprints, I have to use the material.

alt text

Custom Node:

 float2 output; 
 float2 Input1; 
 output = atan2 (In.y,In.x); 
 return (output);
Product Version: UE 4.11
Tags:
more ▼

asked Feb 22 '17 at 10:43 AM in Rendering

avatar image

Jon Langford
69 16 14 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Change the multiply node to be 0,1,1 Change atan2 to be (In.Z, In.Y)

You may need to change 0.25 to something else, depending on how the coordinates work out.

more ▼

answered Feb 22 '17 at 08:05 PM

avatar image

DigitalMage
396 11 8 25

avatar image Jon Langford Feb 23 '17 at 12:41 PM

This is fantastic! Thank you! There is one problem with this however, I rotate the mesh via code around the Z axis, but this messes up the material. Do you know of a way to get both to work together?

avatar image DigitalMage Feb 23 '17 at 03:12 PM

What happens to the material when you use this?

avatar image FrederickD Mar 20 '17 at 11:49 PM

How would one change this to rotate on all axis, to have it completely camera-aligned?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I made a working blueprint for a material that will always face the camera. When applied, the mesh will rotate around the Z or X axis. Attached is a screenshot of the blueprint. Plug the output of either "RotateAboutAxis" into the World Position Offset of the material to to select which axis to rotate around.

The advantage of this blueprint is that the image scales (billboard images don't scale in the editor) and there is no "Custom" function used. Other blueprints I've seen also have the problem of the image not scaling.

I'm hoping someone can help me get both to work together so that this will act the way billboards do and always face the camera in all axis. Currently my blueprint will only rotate in one axis to face the camera.

alt text

more ▼

answered Feb 05 '18 at 08:30 AM

avatar image

ArcheSystems
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question