Author Topic: Billboarding Y-Axis fixed Sprite  (Read 235 times)

Offline Jamiro

  • byte
  • *
  • Posts: 35
    • View Profile
Billboarding Y-Axis fixed Sprite
« 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?



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

Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11898
    • View Profile
    • http://www.jpct.net
Re: Billboarding Y-Axis fixed Sprite
« Reply #1 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?

Offline Jamiro

  • byte
  • *
  • Posts: 35
    • View Profile
Re: Billboarding Y-Axis fixed Sprite
« Reply #2 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?

Offline Jamiro

  • byte
  • *
  • Posts: 35
    • View Profile
Re: Billboarding Y-Axis fixed Sprite
« Reply #3 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

Offline AGP

  • quad
  • ******
  • Posts: 1611
    • View Profile

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11898
    • View Profile
    • http://www.jpct.net
Re: Billboarding Y-Axis fixed Sprite
« Reply #5 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.