Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (549)
Games in Android Showcase (137)
games submitted by our members
Games in WIP (594)
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  
  Geometry batching  (Read 490 times)
0 Members and 1 Guest are viewing this topic.
Offline Quarry
« Posted 2013-04-22 11:26:23 »

Hello JGO, I'd like to know if anyone can provide tutorials or code on this topic.

I want to have a system that creates VAOs or VBOs and renders them in an immediate mode-like way;

GeometryBatch batch = new GeometryBatch(4, TEXTURE_WALL);


batch.rotate(30, 0, 0);
batch.translate(2, 0, 5);
batch.addTexturedNormaledVertex(0, 0, 0, u0, v0, n0x, n0y, n0z);
batch.addTexturedNormaledVertex(1, 0, 0, u1, v1, n1x, n1y, n1z);
batch.addTexturedNormaledVertex(1, 1, 0, u2, v2, n2x, n2y, n2z);
batch.addTexturedNormaledVertex(0, 1, 0, u3, v3, n3x, n2y, n2z);


and after that I can either


without clearing the batch or do the batch.begin(); and batch.end(); parts to reset and rewrite the batch.

Offline davedes
« Reply #1 - Posted 2013-04-22 14:28:06 »

Offline Quarry
« Reply #2 - Posted 2013-04-22 14:58:35 »

Doesn't seem to contain rotation though. Also depends on a lot of other library specific classes
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #3 - Posted 2013-04-22 19:24:17 »

Rotation/translation/etc is achieved by setting a different projModelView matrix.

Of course it depends on a lot of other classes. Roll Eyes If you can't be arsed to write your own ShaderProgram, Mesh, and other utilities, then you should probably not be trying to write your own 3D engine in the first place. It would make more sense to use LibGDX or another framework (Ardor3D, jME, jPCT, etc) to do the heavy lifting for you.

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.

CopyableCougar4 (14 views)
2015-01-26 04:47:56

Olo (14 views)
2015-01-25 21:26:00

Olo (16 views)
2015-01-25 18:44:22

Robo11 (28 views)
2015-01-25 06:14:26

basil_ (26 views)
2015-01-17 22:29:32

wxwsk8er (26 views)
2015-01-16 21:42:21

wxwsk8er (21 views)
2015-01-16 20:44:20

basil_ (25 views)
2015-01-14 09:46:59

basil_ (21 views)
2015-01-14 09:46:52

wxwsk8er (37 views)
2015-01-13 20:42:16
2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

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