Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

3D projection problem => oval circle

This topic is 2763 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've builded a 3D particle system that blows particles in different directions beginning with a particle circle in the middle of the screen.
It works perfect, but I got a realy strange effect.

If I set my projection command like this (look at D3DXToRadian):
D3DXMatrixPerspectiveLH(&tMatrixProjection, D3DXToRadian(45), (FLOAT) SCREEN_WIDTH / (FLOAT) SCREEN_HEIGHT, 1.0f, 100.0f);

The effect is:

But if I set it (D3DXToRadian) to 90 degree:
D3DXMatrixPerspectiveLH(&tMatrixProjection, D3DXToRadian(90), (FLOAT) SCREEN_WIDTH / (FLOAT) SCREEN_HEIGHT, 1.0f, 100.0f);

I got the desired effect:

I initiate my particles once, before I enter the "game loop".
After that, I re-initiate my particles if the radian is greater than 10.
Code here:
// ******************************************************************************************************
void cParticleSystem::initiate()
VERTEX *tVertex;
mRadius = 0.1f;
mPBuffer->Lock(0, 0, (void**)&tVertex, 0);
for(int i=0; i<mCount; i++)
tVertex.position.x = ((float)rand()) / RAND_MAX - 0.5f;
tVertex.position.y = ((float)rand()) / RAND_MAX - 0.5f;
tVertex.position.z = ((float)rand()) / RAND_MAX - 0.5f;
D3DXVec3Normalize(&tVertex.position, &tVertex.position);
tVertex.color = D3DCOLOR_ARGB(255, (int)(128*(tVertex.position.x+1)), (int)(128*(tVertex.position.y+1)), (int)(128*(tVertex.position.z+1)));
tVertex.position = mRadius * tVertex.position;
// ******************************************************************************************************
void cParticleSystem::blowup()
VERTEX *tVertex;
mRadius *= 1.1f;
if(mRadius < 10)
mPBuffer->Lock(0, 0, (void**)&tVertex, 0);
for(int i = 0; i < mCount; i++)
tVertex.position = 1.1f * tVertex.position;
// ******************************************************************************************************

Can someone tell me about this effect ?
I do not quite understand this "oval effect".

Thank you,

Some Information:
- D3D9
- Visual Studio 2010
- Windowed mode
- Resolution: 800x600

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!