Rotate text so it is always square to the camera

Software: Away3D 4.x

drbii, Member
Posted: 28 January 2015 12:32 AM   Total Posts: 72

Hi all,
I’ve got a scene that is being viewed by a hovercontroller.
I created 3D text in my modeling software and am going to import them using Prefab’s AS3 export.
I’d like the text to always look at the camera and remain level as the camera is tilted and panned.  However, when I am elevated ( tilted) the text it is skewed to the view as I pan.  I am setting the rotation of the text negatively to offset the camera’s rotation. So when the camera tilts up the text tilts down.

_FacetText.rotationY = (_cameraController1.panAngle) ;
   
_FacetText.rotationZ = -1*_cameraController1.tiltAngle

Is there a more automatic way that actually keeps the text square to the view?

Thanks.

 

   

Avatar
Fabrice Closier, Administrator
Posted: 28 January 2015 10:43 AM   Total Posts: 1265   [ # 1 ]

You can use the lookAt method, and if you want to lock it to y rotation, right after set rotationX and Z to 0. You can also use the camera forward and use this vector to populate the matrix of each glyph. If you have lots of text, I suggest you avoid lookat and compose instead.

As a side note, I know working with text in 3D is always a pain. One of the newly added feature to Prefab would probably have been handy to you…

 

   

drbii, Member
Posted: 28 January 2015 03:20 PM   Total Posts: 72   [ # 2 ]

Fabrice!  What version of Prefab is that?  Where can I get it?  That looks so helpful! 

 

   

Avatar
Fabrice Closier, Administrator
Posted: 28 January 2015 04:15 PM   Total Posts: 1265   [ # 3 ]

That’s the current dev one. Not ready for spreading yet, tho almost arrived at a point where I could start think about pushing an update…

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X