How to make a plane always face to the camera?

Hello,

Coming from this question: How to build a complex sprite character by pieces (body and nodes)?

I’m developing a 2D engine using plane meshes and textures instead sprites because that allows more possibilities than sprites themselves.

I’m trying to make all plane meshes (simulated sprites) face the camera no matter where the camera is pointing. I don’t have much experience with node materials and I was wondering if it’s possible to make a plane always face the camera no matter where it’s pointing. For what I’ve been reading I think node materials don’t modify the geometry / transform matrix, but I’d like to double check.

Could someone with experience give me some advice on this and if there’s a way to make any plane always face the camera?

I’d like the user to have the freedom to place the camera wherever they want and to make it look at any point.

Otherwise I’d need to build a fixed camera that points to a fixed direction and don’t allow the user to use a custom camera.

Thanks in advance.

By the description 100% that’s the solution, but it is not working with the plane I built.
I’ll be back to you if I find the reason.

Thanks!

1 Like

If you are trying with a custom plane, and it doesn’t work, there is a high chance that’s it’s a rotation issue (if the plane is some how rotated 90° + in billboard mode, then it will be aligned with camera view and therefore invisible (flat))

2 Likes

No… rotating the camera around the plane is there, but it doesn’t face to cam. I tried all billboard factors. I have to check it deeper tomorrow… maybe the reason is because I built the mesh from a VertexData, or some normals issue, no idea, but it is strange.

Basically you need to set the rotation matrix of the plane to the inverted rotation matrix of the camera.

EDIT:
I was looking for a PG and found this:

2 Likes

For some reason the reply of the person who answered the solution disappeared.

The solution is using billboard property in the mesh: BillBoard Mode

0 BILLBOARDMODE_NONE
1 BILLBOARDMODE_X
2 BILLBOARDMODE_Y
4 BILLBOARDMODE_Z
7 BILLBOARDMODE_ALL

I believe that @Tricotou like me, assumed that you have already tried this solution and it didn’t work :crazy_face:

It worked, the problem was in the engine :slight_smile:

1 Like

Sprites using GRL:

I was comparing performance of classic sprites and fake sprites using GreasedLine

1 Like

It is a huge amount of sprites, that’s a good signal.

1 Like

His account has been accidentally flagged as a spammer acount and was deleted. He is back already.

2 Likes

Yeah, but his posts have been permanently deleted. You should have taken a screenshot as a necro :headstone: :sweat_smile:

1 Like