Lens Flare Camera Issue

Started by
-1 comments, last by Psychopathetica 12 years, 2 months ago
I plan on creating lens flares using Billboarding, and even have code to check if the light source is within the viewing frustum, but ran into one issue. At the moment I have a camera that moves like a First person shooter, with the mouse controlling the camera angles, and translating using W S A D. Even thought the billboarded lens flare works great, the problem is that the camera I currently have zooms in/out on the billboarded lens flare as well which is what I don't want. Is there any way I can keep the billlboarded lens flare from zooming in/out and stay the same size regardless where you are in the world? Here is the camera control I am currently using:


Public Sub Camera_Control()

Dim Camera_Translation_Matrix As D3DMATRIX
Dim Camera_Angle_Matrix_X As D3DMATRIX
Dim Camera_Angle_Matrix_Y As D3DMATRIX

D3DXMatrixIdentity Camera_Matrix
D3DXMatrixIdentity Camera_Translation_Matrix

D3DXMatrixTranslation Camera_Translation_Matrix, Camera_Position.X, Camera_Position.Y, Camera_Position.Z
D3DXMatrixMultiply Camera_Matrix, Camera_Matrix, Camera_Translation_Matrix

D3DXMatrixRotationY Camera_Angle_Matrix_Y, (PI * Camera_Angle.Y) / 180
D3DXMatrixMultiply Camera_Matrix, Camera_Matrix, Camera_Angle_Matrix_Y

D3DXMatrixRotationX Camera_Angle_Matrix_X, (PI * Camera_Angle.X) / 180
D3DXMatrixMultiply Camera_Matrix, Camera_Matrix, Camera_Angle_Matrix_X

Device.SetTransform D3DTS_VIEW, Camera_Matrix

End Sub

This topic is closed to new replies.

Advertisement