Java-Gaming.org Hi !
 Featured games (90) games approved by the League of Dukes Games in Showcase (753) Games in Android Showcase (228) games submitted by our members Games in WIP (842) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 3D trigonometry  (Read 1487 times) 0 Members and 1 Guest are viewing this topic.
lcass
 « Posted 2013-10-18 21:34:00 »

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.
Longarmx
 « Reply #1 - Posted 2013-10-18 21:45:18 »

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

lcass
 « Reply #2 - Posted 2013-10-18 22:21:42 »

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

Senior Devvie

Medals: 18

 « Reply #3 - Posted 2013-10-18 23:48:19 »

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.
davedes
 « Reply #4 - Posted 2013-10-19 01:06:09 »

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.

Pages: [1]
 ignore  |  Print

 ivj94 (582 views) 2018-03-24 14:47:39 ivj94 (47 views) 2018-03-24 14:46:31 ivj94 (374 views) 2018-03-24 14:43:53 Solater (61 views) 2018-03-17 05:04:08 nelsongames (108 views) 2018-03-05 17:56:34 Gornova (150 views) 2018-03-02 22:15:33 buddyBro (693 views) 2018-02-28 16:59:18 buddyBro (91 views) 2018-02-28 16:45:17 xxMrPHDxx (493 views) 2017-12-31 17:17:51 xxMrPHDxx (730 views) 2017-12-31 17:15:51
 Java Gaming Resourcesby philfrei2017-12-05 19:38:37Java Gaming Resourcesby philfrei2017-12-05 19:37:39Java Gaming Resourcesby philfrei2017-12-05 19:36:10Java Gaming Resourcesby philfrei2017-12-05 19:33:10List of Learning Resourcesby elect2017-03-13 14:05:44List of Learning Resourcesby elect2017-03-13 14:04:45SF/X Librariesby philfrei2017-03-02 08:45:19SF/X Librariesby philfrei2017-03-02 08:44:05
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org