3D trigonometry

So im trying to challenge myself with 3d.
I understand trig but I cant seem to figure out scaling an image based on the z axis.
I am not using external lirbaries for this as I would like to know how it works fully.

I would recommend Benny for 3D stuff. Check out this for scaling in 3 dimensions with matrices.

Its purely the scaling calculation on its own im stuck on atm but thanks i will check those out.

I could be misunderstanding what you’re looking for, but I you’ll want to look into Linear Algebra for doing 3D calculations.
It sounds like you’re trying to code a rendering pipeline. And since you posted this in the newbie forum, I’m guessing that’s not really want you want to do.
I don’t want to flood this with a wall of text, so the punch line is: there’s a reason things like DirectX and OpenGL exist; they’re an interface to the graphics hardware and
for developers, that’s the lowest level we need to take things. They’re not libraries which handle all the fundamental 3D operations nor required math.

From An API (OpenGL/DirectX) Perspective:
When dealing with points, you simply have a 4x4 Matrix which represents the the xyz rotation/scale/translation.
Then you have a 4D Vector, which represents the coordinate of a point.
Where the point is displayed is basically the result of the matrix multiplied by the vector.
You could try and do all this with Trig, but you’d be making it much harder on yourself. The basic linear algebra you would need to learn is pretty easy to boot. I suck with math and I picked it up in like a day or two.

Images are handled quite differently and you won’t get into that for a bit. You basically create an object with points and then wrap it with a texture.

Java OpenGL Bindings:
In order for Java to talk with OpenGL, it uses bindings. To the best of my knowledge, there’s only LWJGL and JOGL.
They’re mostly just an interface for working with OpenGL. But we’ll prolong the differences for another time.

Java 3D
I’ve never worked with Java 3D. My understanding is it now uses JOGL anyway.

If none of the above helps, then you’ll probably want to specify exactly what it is you’re aiming for and what environment you’re working in (JOGL/LWJGL/something else).
I know you mentioned you’re just trying to scale an image in 3D, but you’d be surprised how open ended that is. Scaling a texture/image in 3D would fall under a specific need for a specific reason and is probably not what you mean.

LibGDX is basically another Java OpenGL binding. More specifically it wraps LWJGL/GLFW on desktop, RoboVM on iOS, WebGL in the browser, and Android’s GL bindings. This (and all the layers of utility on top) makes it a better candidate than LWJGL or JOGL if you hope to support many platforms.