# Scaling a quad to fit pixel size?

I created a custom image class that uses a quad and loads a buffered image from the awt loader. So far I’ve been able to load the image draw it and translate the quad but I’m having trouble with the scale.

geometry.setLocalScale(new Vector3f(dimensions.width, dimensions.height, 1f));

This is the same code used in the picture class and theoretically it should scaled the quad to be equal to screen size in pixels for example 200,400 should make it 200 pixels wide by 400 pixels tall. However when I apply the scale the quad blows up to huge proportions covering the entire screen and more.

What am I doing wrong here ?

I can’t see the code that creates the quad but my guess is that it is not 1,1.

Aye , so it needs to start out 1,1 :> tyvm

Well, you can create the quad in the size you want. Or you can scale the geometry. But if you do both then you end up with something ‘squared’ larger than you want. 200 * 200, 400 * 400.

Does that make sense?

A Quad(200, 400) scaled to 200, 400 is effectively a quad that is 200200, 400400.

yeah , that was an after thought. It makes sense a base size of 1 * 480 = 480 a base size of 100 * 480 = 48,000 :>