Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (542)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (604)
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  
  Isometric 2.5d transformations  (Read 3920 times)
0 Members and 1 Guest are viewing this topic.
Offline straykiwi

Junior Newbie





« Posted 2012-09-26 22:43:36 »



Hi there, I am new to this forum.
I am making a isometric game, and @riven's transformation matrix has been really helpful so far. http://www.java-gaming.org/index.php?topic=19927.0

I currently have a list of vectors and colors for the top face of a 'wall-tile' but I want to fill out this wall tile so that it looks 3d. What I need is 2 transformation matrices that can do this transformation, but i have no idea on how to construct them.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 849
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2012-09-26 23:13:39 »

You posted this in the Java2D board, but you really need 3D transformation matrices (4x4), so you cannot use the AffineTransforms of Java2D.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline straykiwi

Junior Newbie





« Reply #2 - Posted 2012-09-26 23:17:22 »

That is true. Sorry, I keep thinking that this is 2.5d and it is messing up my thinking. Could you perhaps move this to that section and answer it there?

My apologies for posting in the wrong section, I am new here.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 849
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2012-09-26 23:18:47 »

How are you drawing your graphics?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline straykiwi

Junior Newbie





« Reply #4 - Posted 2012-09-26 23:23:08 »

Using this method for each tile. Quite similar to what you had in the 2.5d post i linked earlier
 
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
List<float[]> quads = t.getQuads();
List<Color> colorList = t.getColors();
float[] view = new float[3];  
       for (int i = 0; i < quads.size(); i++)
         {
           
            g.setColor(colorList.get(i));
     
     
         Polygon p = new Polygon();
         for (int k = 0; k < 4; k++) {
            float[] model = quads.get(i).clone();

            model[0] += xRel[k];
            model[2] += yRel[k];
            Matrix44 isom = Matrix44.isoMatrix(scale,
                  locX, locY);
            view = isom.multiply(model);

            p.addPoint((int) view[0], (int) view[1]);
         }

         g.fillPolygon(p);
      }
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 849
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2012-09-26 23:38:22 »

You can't do much more than wireframe and/or opaque, solid colored surfaces, with isometric projection in Java2D.

So you might wonder whether you're doing the sensible thing, or that you should look into OpenGL.

Regardless of the rendering engine, you really need to look up matrix transformations, if you want to get anywhere with rendering.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline straykiwi

Junior Newbie





« Reply #6 - Posted 2012-09-26 23:40:08 »

Ok thanks
Offline orange451

JGO Coder


Medals: 18
Projects: 2
Exp: 4 years


Your face. Your ass. What's the difference?


« Reply #7 - Posted 2012-10-06 22:19:18 »

You can't do much more than wireframe and/or opaque, solid colored surfaces, with isometric projection in Java2D.
Though, you can still make some pretty cool 3d stuff with just Graphics2D Smiley

this is a project I started, that was made with just Java (using Graphics2D for rendering):

Working on a nice FPS in lwjgl Smiley http://i.imgur.com/q4uFqBS.png
Feel free to message me if you're interested!
Offline matheus23

JGO Kernel


Medals: 114
Projects: 3


You think about my Avatar right now!


« Reply #8 - Posted 2012-10-07 09:07:29 »

You can't do much more than wireframe and/or opaque, solid colored surfaces, with isometric projection in Java2D.
Though, you can still make some pretty cool 3d stuff with just Graphics2D Smiley

this is a project I started, that was made with just Java (using Graphics2D for rendering):

... ...
Seriously, did you REALLY create that?
(Where did you get those models, btw)
And how fast was it running?

I'm skeptical. But cool stuff, bro Grin

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline orange451

JGO Coder


Medals: 18
Projects: 2
Exp: 4 years


Your face. Your ass. What's the difference?


« Reply #9 - Posted 2012-10-07 13:57:38 »

... ...
Seriously, did you REALLY create that?
(Where did you get those models, btw)
And how fast was it running?

I'm skeptical. But cool stuff, bro Grin
The models are made in code Smiley
I used a little bit of Notches code (from his old player running animation applet used for testing minecraft skins) in order to learn how polygonal rendering worked.
Then I made a running character in java, then a block, then a chunk, then multiple chunks, then I created my own frustum culling, then I made random terrain, then I started some simple player physics, and viola! Smiley

I get about 50-100 fps while running the game (I get about 30-200 fps in minecraft) Tongue

Working on a nice FPS in lwjgl Smiley http://i.imgur.com/q4uFqBS.png
Feel free to message me if you're interested!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Quarry
« Reply #10 - Posted 2012-10-08 16:50:25 »

Wow! Mind sharing the code?
Offline theagentd

« JGO Bitwise Duke »


Medals: 366
Projects: 2
Exp: 8 years



« Reply #11 - Posted 2012-10-09 20:22:05 »

... ...
Seriously, did you REALLY create that?
(Where did you get those models, btw)
And how fast was it running?

I'm skeptical. But cool stuff, bro Grin
The models are made in code Smiley
I used a little bit of Notches code (from his old player running animation applet used for testing minecraft skins) in order to learn how polygonal rendering worked.
Then I made a running character in java, then a block, then a chunk, then multiple chunks, then I created my own frustum culling, then I made random terrain, then I started some simple player physics, and viola! Smiley

I get about 50-100 fps while running the game (I get about 30-200 fps in minecraft) Tongue
Notice the view-distance; about the length of an arm. =S

Myomyomyo.
Offline matheus23

JGO Kernel


Medals: 114
Projects: 3


You think about my Avatar right now!


« Reply #12 - Posted 2012-10-09 20:33:04 »

Notice the view-distance; about the length of an arm. =S
Agree, but notice the implementation: cpu...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline orange451

JGO Coder


Medals: 18
Projects: 2
Exp: 4 years


Your face. Your ass. What's the difference?


« Reply #13 - Posted 2012-10-09 22:00:41 »

Notice the view-distance; about the length of an arm. =S
In that picture, the view distance is about the same as Minecrafts "short" render distance, perhaps slightly farther.

The lag isn't from drawing, but inefficiencies in the code.
I can get almost double that rendering distance (which is about a little farther than minecrafts "normal" rendering distance), and get 30-50 fps Smiley

The problem is that each block is stored as a Model object, and each Model has polygon objects, and each polygon has Vertex objects. If I can completely get rid of the vertices, and have them as variables inside the polygon, then I could potentially get a much higher frame rate. However, this is a really impractical thing to do Tongue

Working on a nice FPS in lwjgl Smiley http://i.imgur.com/q4uFqBS.png
Feel free to message me if you're interested!
Offline matheus23

JGO Kernel


Medals: 114
Projects: 3


You think about my Avatar right now!


« Reply #14 - Posted 2012-10-10 16:56:32 »

You might consider doing this.

I think minecraft stores blocks as either int, or short or char at runtime. (I think it saves as byte, but I'm not sure...)

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline orange451

JGO Coder


Medals: 18
Projects: 2
Exp: 4 years


Your face. Your ass. What's the difference?


« Reply #15 - Posted 2012-10-10 18:15:14 »

You might consider doing this.

I think minecraft stores blocks as either int, or short or char at runtime. (I think it saves as byte, but I'm not sure...)
They are.
The block id's are stored as bytes in a byte array in the chunk.
I also store the entire model of the chunk so I can loop through that array every frame update to draw the chunk, rather than recreate all the polygons every step (which would be MUCH slower).

Working on a nice FPS in lwjgl Smiley http://i.imgur.com/q4uFqBS.png
Feel free to message me if you're interested!
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.

Elsealabs (10 views)
2014-12-28 10:39:27

CopyableCougar4 (17 views)
2014-12-28 02:10:29

BurntPizza (21 views)
2014-12-27 22:38:51

Mr.CodeIt (14 views)
2014-12-27 04:03:04

TheDudeFromCI (19 views)
2014-12-27 02:14:49

Mr.CodeIt (26 views)
2014-12-23 03:34:11

rwatson462 (57 views)
2014-12-15 09:26:44

Mr.CodeIt (47 views)
2014-12-14 19:50:38

BurntPizza (94 views)
2014-12-09 22:41:13

BurntPizza (115 views)
2014-12-08 04:46:31
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!