Jump to content
  • Advertisement
Sign in to follow this  
TheSkiD

3D projection problem => oval circle

This topic is 2274 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

Hello,

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:
radian45degree.jpg

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:
radian90degree.jpg

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;
srand(100);
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;
}
mPBuffer->Unlock();
}
// ******************************************************************************************************
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;
mPBuffer->Unlock();
}
else
initiate();
}
// ******************************************************************************************************


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

Thank you,
Manic.


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

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!