TBillboard always points toward the current camera allowing for such effects as a 2D billboard (if you add a textured rectangle to the frame).
ProtoObjectObjectTObjectTFrameTGroupTBillboard
| cameraNorm | selectedPoint |
| instance | class |
|---|---|
| render | no messages
|
| cameraNorm |
|---|
| selectedPoint |
|---|
| render |
|---|
| renderFrame: ogl parent: parent root: root |
| cam mat pos out target dir sin angle | cam := ogl camera. cam ifNotNil:[ mat := self globalTransform. pos := mat a14 @ mat a34. out := (mat a13 @ mat a33) normalized. mat := cam globalTransform. target := mat a14 @ mat a34. dir := (target - pos) normalized. sin := dir crossProduct: out. angle := (dir dotProduct: out) arcCos radiansToDegrees. mat := B3DMatrix4x4 identity. mat rotationAroundY: angle * sin sign. self transformBy: mat. ]. ^super renderFrame: ogl parent: parent root: root. |
| renderFrame: ogl space: space |
| cam mat pos out target dir sin angle | cam := ogl camera. cam ifNotNil:[ mat := self globalTransform. pos := mat a14 @ mat a34. out := (mat a13 @ mat a33) normalized. mat := cam globalTransform. target := mat a14 @ mat a34. dir := (target - pos) normalized. sin := dir crossProduct: out. angle := (dir dotProduct: out) arcCos radiansToDegrees. mat := B3DMatrix4x4 identity. mat rotationAroundY: angle * sin sign. self transformBy: mat. ]. ^super renderFrame: ogl space: space. |