Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  3D trigonometry  (Read 475 times)
0 Members and 1 Guest are viewing this topic.
Offline 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.
Offline 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.

Offline 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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Redocdam

Senior Duke


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.
Offline 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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

theagentd (20 views)
2014-10-25 15:46:29

Longarmx (53 views)
2014-10-17 03:59:02

Norakomi (47 views)
2014-10-16 15:22:06

Norakomi (35 views)
2014-10-16 15:20:20

lcass (39 views)
2014-10-15 16:18:58

TehJavaDev (70 views)
2014-10-14 00:39:48

TehJavaDev (69 views)
2014-10-14 00:35:47

TehJavaDev (61 views)
2014-10-14 00:32:37

BurntPizza (74 views)
2014-10-11 23:24:42

BurntPizza (47 views)
2014-10-11 23:10:45
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!