PDA

View Full Version : Rotation along the Y-axis



2lights
15th August 2013, 17:08
Overview of program, to understand Question
I'm loading an image in type QImage
Then I paint the image in label,
& allow user to make markings on image (draw point/ellipse/...)
After the user finish editing the image
All the points the user created via mouse clicks is stored in an array.

Later in the program I'm rotating image along the y-axis then repainting the image.
but when I paint all the points that were stored in array its not being rotated accordingly(naturally)

The rotation of image along the y-axis.... Works
How do I rotate the points along the same axis so its inline with image

ie(creating a perspective look on output)

code to transform image


//before paint function
QTransform pptv;
pptv.rotate(-60, Qt::YAxis);
image1 = image1.transformed(pptv);
imageDrawFlag1 = true;

& i paint the transformed image
but when it comes to repainting the points:confused:


//In paint function
foreach(tempPoint, markers)
{
painter.drawEllipse(tempPoint, 5, 5);
}
//painter.rotate -> only allows an integer, Does not allow which axis


How would I go about solving this issue?

Kind Regards

Having some network issues today, my posts or responses might be delayed

danics
15th August 2013, 21:51
can you save all of your paintings in another image, and rotate that image?

ChrisW67
16th August 2013, 00:06
What happens if you call QPainter::setTransform() with the same transform?

2lights
16th August 2013, 08:37
QPainter::setTransform() with the same transform... Works

Thanks