Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (569) Games in Android Showcase (154) games submitted by our members Games in WIP (618) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 3D trigonometry  (Read 597 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: 17

 « 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

You cannot reply to this message, because it is very, very old.

 Riven (21 views) 2015-04-16 10:48:47 Duke0200 (34 views) 2015-04-16 01:59:01 Fairy Tailz (26 views) 2015-04-14 20:13:12 Riven (26 views) 2015-04-12 21:36:37 bus hotdog (44 views) 2015-04-10 02:39:32 CopyableCougar4 (45 views) 2015-04-10 00:51:04 BurntPizza (45 views) 2015-04-06 22:06:58 ags1 (49 views) 2015-04-02 10:58:48 Riven (49 views) 2015-04-01 18:27:05 ags1 (66 views) 2015-03-31 10:55:12
 BurntPizza 24x theagentd 21x wessles 15x 65K 12x Rayvolution 12x kingroka123 11x alwex 10x KevinWorkman 9x kevglass 8x SHC 8x ra4king 8x phu004 8x Ecumene 7x chrislo27 7x Roquen 7x Hanksha 7x
 How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27
 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