Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (798)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (865)
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  
  New JOGL Chapter Online (OBJ models, picking, JOAL, fog)  (Read 4295 times)
0 Members and 1 Guest are viewing this topic.
Offline Andrew Davison

Junior Devvie


Medals: 2



« Posted 2007-01-02 04:48:52 »

Dear All,

I've just added a new chapter on JOGL to the Killer Game Programming in Java website at http://fivedots.coe.psu.ac.th/~ad/jg/. It's in the JOGL section near the bottom of the page.

The chapter is called JOGL 3. Picking on the Models.

This chapter is about four things: loading and positioning Wavefront OBJ models, picking with the mouse, 3D sound using JOAL, and fog. The OBJ model loader supports shapes with multiple colors and textures.

Comments are appreciated.

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #1 - Posted 2007-01-02 22:16:43 »

Looks like a nice step-by-step tutorial. The content seems technically correct to me.
Offline Ultraq

Junior Devvie




That's what she said


« Reply #2 - Posted 2007-01-02 23:11:17 »

Curious: why is JOAL in this topic?  I know you dedicated an entire chapter to JOAL a while back (and I read it too), so I'm just wondering how JOAL fits into a topic on picking?

Ultraq's Final MooCow
Bits and Pieces by Emanuel Rabina
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Andrew Davison

Junior Devvie


Medals: 2



« Reply #3 - Posted 2007-01-03 01:38:37 »

JOAL's included because it's fun to have 3D sound Smiley, and it shows that I can reuse the code I  wrote for adding 3D sound to my earlier Java 3D example.

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline K.I.L.E.R

Senior Devvie




Java games rock!


« Reply #4 - Posted 2007-01-03 04:22:48 »

Just a question.

Why not also explain picking in terms of moving through coordinate systems and bounding volumes?

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline Andrew Davison

Junior Devvie


Medals: 2



« Reply #5 - Posted 2007-01-03 04:44:32 »


The second JOGL chapter explains how the camera position can be checked to see if the user is near something (in the example, it's a billboard on the floor), so it shoudn't be too hard to generalise that to volumes.

The picking in this chapter is unique to OpenGL, and a good way of implementing user interaction with the mouse.

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline zebhed

Junior Newbie





« Reply #6 - Posted 2007-02-04 23:32:56 »

I´ve tried the source code.

there is a problem with the OBJ loader. the penguin example is loaded correctly, but when i take other models (not your examples) their textures are misaligned. these models only have one texture file.

but the models are definitely correct. when i use the java 3d OBJ loader every texture is aligned correctly.



Offline Andrew Davison

Junior Devvie


Medals: 2



« Reply #7 - Posted 2007-02-05 02:20:00 »

zebhed,

If possible, can you send me one of your problem models, and perhaps a screenshot of how it should look. Then I'll do some testing of the code.

Please contact me directly, at ad@fivedots.coe.psu.ac.th.

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline zebhed

Junior Newbie





« Reply #8 - Posted 2007-02-05 11:18:26 »

sent Smiley
Offline Andrew Davison

Junior Devvie


Medals: 2



« Reply #9 - Posted 2007-02-06 03:45:40 »

Martin,

I tested your models using Java SE 6 and JSR-231 1.1.0 RC 2,and got the same problem. In fact, it also started happening to my penguin example as well.

The problem seems to lie in JOGL's TextureIO class. It's flipping the loaded image around the y-axis.

The simplest solution right now is to use a graphics program to flip the image around the y-axis, and supply that as the image used by the MTL file.

I tried this for your gorilla and house images, and the models are textured correctly.

I'll open a new thread about this problem.

I could hack together some code for reversing the flipping,
but it seems better to fix TextureIO.

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Andrew Davison

Junior Devvie


Medals: 2



« Reply #10 - Posted 2007-02-07 07:25:37 »

I've recoded the loader to flip the model's texture coordinates depending on the result of Texture.getImageTexCoords(). The examples sent to me by zebhed, and my own, now render correctly in JOGL 1.1.0 RC 2.

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (43 views)
2019-09-04 15:33:17

hadezbladez (4008 views)
2018-11-16 13:46:03

hadezbladez (1463 views)
2018-11-16 13:41:33

hadezbladez (4028 views)
2018-11-16 13:35:35

hadezbladez (777 views)
2018-11-16 13:32:03

EgonOlsen (4096 views)
2018-06-10 19:43:48

EgonOlsen (4681 views)
2018-06-10 19:43:44

EgonOlsen (2761 views)
2018-06-10 19:43:20

DesertCoockie (3656 views)
2018-05-13 18:23:11

nelsongames (3866 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
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!