Jump to content
  • Advertisement
Sign in to follow this  

Lens Flare Camera Issue

This topic is 2818 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!