Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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  
  PNG Images bottom-up?  (Read 2053 times)
0 Members and 1 Guest are viewing this topic.
Offline Caoimhin

Junior Member





« Posted 2003-07-18 22:56:33 »

I'm trying to use the PNG loader example in HWShadowmapsSimple.java and my textures are loading upside down and backwards.  I'm not real familiar with the PNG format so I don't know if it's normally a bottom-up rather than top-down format.

I can't run the HWShadowmapsSimple example as I only have a GeForce2 card.  But as my textures have text, it became really obvious that something is seriously wrong.

Or is there something with ImageIO that needs to be set to load the image correctly?
Offline tortoise

Junior Member




<3 Shmups


« Reply #1 - Posted 2003-07-19 03:10:07 »

Are you sure you're not placing the texture upside down? I've done that a few times since OpenGL does the rather unintuitive lower left being 0,0 business.
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #2 - Posted 2003-07-19 14:39:37 »

... and you have to create your polygons counter-clockwise.
it is not so unfamiliar if you an mathematician ...

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #3 - Posted 2003-07-19 14:49:37 »

If you load in .png images with ImageIO you will have to do an Affine transform to flip them.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Archimedes
Guest
« Reply #4 - Posted 2003-07-19 15:57:18 »

Quote
If you load in .png images with ImageIO you will have to do an Affine transform to flip them.

Oh, probably this mean that the origin of a PNG is top left... And Ogl textures have their origins at the bottom left.

Now I see why my textures also got bottom-up (however with wood and marble textures you hardly notice it in the first instance).

Thanks for the hint.
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.

xsi3rr4x (53 views)
2014-04-15 18:08:23

BurntPizza (51 views)
2014-04-15 03:46:01

UprightPath (65 views)
2014-04-14 17:39:50

UprightPath (48 views)
2014-04-14 17:35:47

Porlus (65 views)
2014-04-14 15:48:38

tom_mai78101 (89 views)
2014-04-10 04:04:31

BurntPizza (149 views)
2014-04-08 23:06:04

tom_mai78101 (245 views)
2014-04-05 13:34:39

trollwarrior1 (203 views)
2014-04-04 12:06:45

CJLetsGame (210 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!