• Create Account

### #ActualxDarkice

Posted 30 January 2012 - 11:12 AM

Thanks for your answer, please take a look at the snow at the bottom. The snow will lose one triangle of the quad. It only appears when I rotate these snow flocks. If they arent rotated they will display properly

By the way this is how I am roting a quad:

if (rect.Rotation != 0)
{
rect.Rotation = rect.Rotation * (float)Math.PI / 180;
float centerX = (rx1 + rx2) / 2f;
float centerY = -(ry1 + ry2) / 2f;

Matrix originTranslation = _Device.GetTransform(TransformState.World);
Matrix translationA = Matrix.Translation(-centerX, -centerY, 0);
Matrix rotation = Matrix.RotationZ(-rect.Rotation);
Matrix translationB = Matrix.Translation(centerX, centerY, 0);

Matrix result = translationA * rotation * translationB * originTranslation;

_Device.SetTransform(TransformState.World, result);
}


This is the full source code: http://pastebin.com/yDDuiZV1
I am happy for every improvement ideas =)

I think its the Orthographic Projection I'm using. If a Point of a Vertex would go over my Projection it wont show up I believe, but in OpenGL it does its really confusing and im stuck here

### #7xDarkice

Posted 29 January 2012 - 06:40 AM

Thanks for your answer, please take a look at the snow at the bottom. The snow will lose one triangle of the quad. It only appears when I rotate these snow flocks. If they arent rotated they will display properly

By the way this is how I am roting a quad:

if (rect.Rotation != 0)
{
rect.Rotation = rect.Rotation * (float)Math.PI / 180;
float centerX = (rx1 + rx2) / 2f;
float centerY = -(ry1 + ry2) / 2f;

Matrix originTranslation = _Device.GetTransform(TransformState.World);
Matrix translationA = Matrix.Translation(-centerX, -centerY, 0);
Matrix rotation = Matrix.RotationZ(-rect.Rotation);
Matrix translationB = Matrix.Translation(centerX, centerY, 0);

Matrix result = translationA * rotation * translationB * originTranslation;

_Device.SetTransform(TransformState.World, result);
}


This is the full source code: http://pastebin.com/yDDuiZV1
I am happy for every improvement ideas =)

### #6xDarkice

Posted 29 January 2012 - 06:39 AM

Thanks for your answer, please take a look at the snow at the bottom. The snow will lose one triangle of the quad. It only appears when I rotate these snow flocks. If they arent rotated they will display properly

By the way this is how I am roting a quad:

if (rect.Rotation != 0)
{
rect.Rotation = rect.Rotation * (float)Math.PI / 180;
float centerX = (rx1 + rx2) / 2f;
float centerY = -(ry1 + ry2) / 2f;

Matrix originTranslation = _Device.GetTransform(TransformState.World);
Matrix translationA = Matrix.Translation(-centerX, -centerY, 0);
Matrix rotation = Matrix.RotationZ(-rect.Rotation);
Matrix translationB = Matrix.Translation(centerX, centerY, 0);

Matrix result = translationA * rotation * translationB * originTranslation;

_Device.SetTransform(TransformState.World, result);
}


This is the full source code: http://pastebin.com/yDDuiZV1

### #5xDarkice

Posted 29 January 2012 - 05:37 AM

Thanks for your answer, please take a look at the snow at the bottom. The snow will lose one triangle of the quad. It only appears when I rotate these snow flocks. If they arent rotated they will display properly

By the way this is how I am roting a quad:

if (rect.Rotation != 0)
{
rect.Rotation = rect.Rotation * (float)Math.PI / 180;
float centerX = (rx1 + rx2) / 2f;
float centerY = -(ry1 + ry2) / 2f;

Matrix originTranslation = _Device.GetTransform(TransformState.World);
Matrix translationA = Matrix.Translation(-centerX, -centerY, 0);
Matrix rotation = Matrix.RotationZ(-rect.Rotation);
Matrix translationB = Matrix.Translation(centerX, centerY, 0);

Matrix result = translationA * rotation * translationB * originTranslation;

_Device.SetTransform(TransformState.World, result);
}


### #4xDarkice

Posted 29 January 2012 - 05:33 AM

Thanks for your answer, please take a look at the snow at the bottom. The snow will lose one triangle of the quad. It only appears when I rotate these snow flocks. If they arent rotated they will display properly

By the way this is how I am roting a quad:

if (rect.Rotation != 0)
{
rect.Rotation = rect.Rotation * (float)Math.PI / 180;
float centerX = (rx1 + rx2) / 2f;
float centerY = -(ry1 + ry2) / 2f;

Matrix originTranslation = _Device.GetTransform(TransformState.World);
Matrix translationA = Matrix.Translation(-centerX, -centerY, 0);
Matrix rotation = Matrix.RotationZ(-rect.Rotation);
Matrix translationB = Matrix.Translation(centerX, centerY, 0);

Matrix result = translationA * rotation * translationB * originTranslation;

_Device.SetTransform(TransformState.World, result);
}


EDIT: Its not the Viewport but my Orthographic Projection.

### #3xDarkice

Posted 28 January 2012 - 08:23 AM

Thanks for your answer, please take a look at the snow at the bottom. The snow will lose one triangle of the quad. It only appears when I rotate these snow flocks. If they arent rotated they will display properly

By the way this is how I am roting a quad:

if (rect.Rotation != 0)
{
rect.Rotation = rect.Rotation * (float)Math.PI / 180;
float centerX = (rx1 + rx2) / 2f;
float centerY = -(ry1 + ry2) / 2f;

Matrix originTranslation = _Device.GetTransform(TransformState.World);
Matrix translationA = Matrix.Translation(-centerX, -centerY, 0);
Matrix rotation = Matrix.RotationZ(-rect.Rotation);
Matrix translationB = Matrix.Translation(centerX, centerY, 0);

Matrix result = translationA * rotation * translationB * originTranslation;

_Device.SetTransform(TransformState.World, result);
}


PARTNERS