www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Jamiro on July 08, 2018, 03:56:57 pm

Title: Billboarding Y-Axis fixed Sprite
Post by: Jamiro on July 08, 2018, 03:56:57 pm
Hello,

I know we can change the billboarding matrix of an object, I tried to play around with this but without success, so my question is:

How can I make a matrix to simulate a billboarding effect while keeping its vertical axis fixed, as the example bellow shows in the first case?

(https://i.imgur.com/SgoHsMx.png)

can anyone give me an example of what this matrix should be to have the desired effect?

Thanks
Title: Re: Billboarding Y-Axis fixed Sprite
Post by: EgonOlsen on July 08, 2018, 06:09:22 pm
Maybe you can take the normal billboard matrix and apply a rotation around the object's x axis to that matrix in a second step?
Title: Re: Billboarding Y-Axis fixed Sprite
Post by: Jamiro on July 08, 2018, 06:31:26 pm
In that case wont I stil have the tilting of the relative Y axix of the object? I don't understand much about matrices but can I just  set a value to a fixed zero or 1 to always make it steady on its relative Y axis?

and also, is there even a name for this? os some concept for this type of billboarding that I can look for?
Title: Re: Billboarding Y-Axis fixed Sprite
Post by: Jamiro on July 11, 2018, 03:36:20 pm
Ok, so I just need to ask 1 simples question, do I need to update the billboarding matrix on each draw step? Or is the matrix itself capable of using camera space and need only to be changed once?

so, when I choose setBillboarding(true) will the jpct engine update on each frame the matrix according to the camera facing vector?

many thanks
Title: Re: Billboarding Y-Axis fixed Sprite
Post by: AGP on July 13, 2018, 12:58:42 am
Check this out:

http://www.jpct.net/forum2/index.php/topic,1448.msg10327/topicseen.html#msg10327 (http://www.jpct.net/forum2/index.php/topic,1448.msg10327/topicseen.html#msg10327)
Title: Re: Billboarding Y-Axis fixed Sprite
Post by: EgonOlsen on July 16, 2018, 11:12:39 am
so, when I choose setBillboarding(true) will the jpct engine update on each frame the matrix according to the camera facing vector?
Yes, it updates it every frame. And so should you.