Log in or register to post comments

Real image size

April 27, 2012 - 12:56am #1

Hi,

Basically, my question is very simple, and I just want to make sure that I get things right.
I followed (successfully) the instruction from this link: https://ar.qualcomm.at/qdevnet/forums
in order to render a 2D image.

Now, assuming that the real size of my image is twice as big as the size of the image target, and I want to use the target size in order to set the drawing area accordingly.

My question is whether I should set the planeVertices to:
static const float planeVertices[] =
{
-1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 1.0, 1.0, 0.0, -1.0, 1.0, 0.0,
};
or maybe to write something like this:
SampleUtils::scalePoseMatrix(2.0 * targetSize.data[0], 2.0 * targetSize.data[1], 1.0f, &modelViewMatrix.data[0]);

Are these two solutions valid/equivalent?

More over, what does the 'kObjectScale' stand for?
And why is it set to '3'?

Best,
S.

Re: Real image size

April 29, 2012 - 10:02am #4

I was defining a unit plane as one that is 1 unit across, centered at the origin (hence -0.5, 0.5). Use what works best for you though!

- Kim

Re: Real image size

April 28, 2012 - 10:29am #3

Thanks Kim,
I'd also vote for the unit plan solution (and setting the scale), but I thought maybe there's a specific reason for which you (Kim) chose to use '0.5' in the example you posted for 2D rendering.

If both solutions are equivalent, I'd also prefer to use the unit plane approach.

Tnx,
S.

Re: Real image size

April 27, 2012 - 4:08pm #2
Quote:

Are these two solutions valid/equivalent?

Yes, they are basically equivalent. I would argue that working with a unit plane and setting the scale is the cleanest approach.

kObjectScale is just a variable used by the samples to scale the teapot up to a reasonable size for the target.

- Kim

Log in or register to post comments