Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Xith3D Forums / How to do stars? on: 2005-05-11 18:40:57
Note: I've already posted a bit on this related to skybox - but a skybox has problems when you rotate it.

My problem is how to get stars displayed around the player. Obviously there are too many stars to realistically add all of them, so some sort of image mapping is likely.

Has anyone done this - got any ideas - pointers or whatever?

I've also given a little more detail of my application that may help below...

Cheers
 Andy Stratton
----------------------

My particular application (a space game) has some extra features that may make it easier to produce the stars:

1. Ships remain essentially on the horizontal - i.e they can move in x and z freely, but are limited in the y dimension (to a couple of hundred metres max).
2. Ships can rotate around the z axis only (though a little x and y rotation is likely to be added to make turning and climb/dive more look better). i.e. there is no significant rolling or pitching.

This means that the star sphere (as I previously called it) could just be a star cylinder and still work. The player shouldn't be able to see directly up or down.
2  Java Game APIs & Engines / Xith3D Forums / Re: Blender 3D and Xith on: 2005-05-06 18:05:59
Have you tried the newdawn loader? I have used it successfully to load obj files saved from art of illusion.

Let me know if you would like a sample file to try.

Here's my loader:

           BranchGroup bgasteroid = null;
       try {
             bgasteroid = new OBJLoader().load("./asteroid.obj");
             solarSystem.getRootGroup().addChild(bgasteroid);
       } catch (Exception e) {
           e.printStackTrace();
           System.exit(0);
       }

Replace solarSystem.getRootGroup() by your root node...

Cheers
 Andy Stratton
3  Java Game APIs & Engines / Xith3D Forums / Re: Art of Illusion compatibility with Xith3D on: 2005-04-22 12:04:24
Hawkwind
 Thanks for the obj export code - the attributes part looks really useful - but I haven't got that far yet!  I hope to be able to use it later...

Cheers
 Andy
4  Java Game APIs & Engines / Xith3D Forums / Re: SkyBox works - how about SkySphere? on: 2005-04-22 12:00:01
No - you've correctly guessed - it's not working. I was hoping someone might spot an obvious error!

The obj that is imported has an mtl file associated that has the texture set on it. If I add the object to the top (root) branchgroup, it works (except that it is lit from one side of course). At this point, it is just a standard branchgroup, as listed next:

---------------------------------
           root.addChild(getStarSphere());
....
     private BranchGroup getStarSphere() {
           BranchGroup result = null;
       try {
               result = new OBJLoader().load("./starsphere.obj");
       } catch (Exception e) {
           e.printStackTrace();
           System.exit(0);
       }
       return result;
   }
--------------------------------------------

Of course - when you move, you move outside the sphere and see it from the outside.

If I do:

----------------
           SkyBox s = new SkyBox("stars.jpg");
           root.addChild(s);
-----------------
Then I get a skybox with the associated distortion on rotating the box (which I'm trying to avoid).

If I do:
----------
           StarSphere s = new StarSphere("stars.jpg");
----------
Instead of the skybox line above, then I get a white background.

Finally, here is the class for the StarSphere (should be the same as before - but I don't want to assume anything...:):

-----------------------

public class StarSphere extends Background {
   
   public StarSphere (String filename) {
           
           BranchGroup starSphere = getSphere(filename);

           // Sets the geometry of this Background node to be the created sphere
           setGeometry(starSphere);
   }
   
   public BranchGroup getSphere(String filename)
   {
           BranchGroup result = null;
       try {
               result = new OBJLoader().load("./starsphere.obj");
       } catch (Exception e) {
           e.printStackTrace();
           System.exit(0);
       }

       Object obj = result.getChild(0);
       BranchGroup bg = null;
       while ((obj != null) && (obj instanceof BranchGroup))
       {
             bg = (BranchGroup)obj;

             obj = bg.getChild(0);
       }
           for (int i = 0; i < bg.getChildren().size(); i++) {
                 // Disable depth buffer
                 Appearance a = new Appearance();
                 a.setRenderingAttributes(new RenderingAttributes());
                 a.getRenderingAttributes().setDepthBufferWriteEnable(false);
                 ((Shape3D)bg.getChild(i)).setAppearance(a);
           }
           return result;
   }
}

------------------------------

I also tried constructing a sphere and setting the material directly at one point - but didn't get anywhere and ended up wiping the code...

Cheers
 Andy Stratton
5  Java Game APIs & Engines / Xith3D Forums / SkyBox works - how about SkySphere? on: 2005-04-21 18:17:38
I have SkyBox working - but the visual effect is very obviously a box (especially when you wish to show a 3d star scape). What I am looking for is a sphere based star map to project around my view - it doesn't need to move (interstellar distances could be handled by regenerating the images when a great distance is moved). At present it doesn't need to be accurate, just work!

Ideally I would project 6 different sphere views onto the sphere. The box doesn't seem to work well - the angles of the box give different perspective and rotate stangely...

I've put my code below - but it's probably miles off - thanks to William Denis for a starter with SkyBox...

The loaded object is a simple sphere with an image texture mapped to it (using art of illusion).

Cheers
 Andy Stratton

-----------------------------------------
public class StarSphere extends Background {
   
   public StarSphere (String filename) {
           
           BranchGroup starSphere = getSphere(filename);

           // Sets the geometry of this Background node to be the created sphere
           setGeometry(starSphere);
   }
   
   public BranchGroup getSphere(String filename)
   {
           BranchGroup result = null;
       try {
               result = new OBJLoader().load("./starsphere.obj");
       } catch (Exception e) {
           e.printStackTrace();
           System.exit(0);
       }
       Object obj = result.getChild(0);
       BranchGroup bg = null;
       while ((obj != null) && (obj instanceof BranchGroup))
       {
             bg = (BranchGroup)obj;
                    obj = bg.getChild(0);
       }
           for (int i = 0; i < bg.getChildren().size(); i++) {
                 // Set texture and disable depth buffer
                 Appearance a = new Appearance();
                 a.setRenderingAttributes(new RenderingAttributes());
                 a.getRenderingAttributes().setDepthBufferWriteEnable(false);
                 ((Shape3D)bg.getChild(i)).setAppearance(a);
           }
           return result;
         
   }
   
}
6  Java Game APIs & Engines / Xith3D Forums / Re: Art of Illusion compatibility with Xith3D on: 2005-04-19 06:32:28
Thanks for the offer of the individual file save. Does it do more than the standard single object export?  I've used that before - though I can't remember if the materials worked.

Cheers
 Andy
7  Java Game APIs & Engines / Xith3D Forums / Art of Illusion compatibility with Xith3D on: 2005-04-18 08:56:56
Very briefly - I have managed to get art of illusion models imported into xith3d - and wondered if anyone had any experience with some issues I am having:-

1. I'm using the new dawn obj loader - which seems to work fine, but the names of the objects don't seem to be transferred over. I was hoping to create multiple objects in a scene, then identify them and manipulate them (i.e make them appear and disappear) as need be. i.e. getName() returns empty.

2. I'm exporting the whole scene and generating an mtl file - but the rendered xith3d scene has some wierd artifacts that aren't visible in the aoi scene. I realise that there is a difference in the rendering - but wondered if there is a way to make aoi more closely represent the xith3d equivalent.

3. I was hoping to use some of the aoi texture and material generators - but it seems that really only images are supported. Does anyone know if anything else will work?  Sorry to be so vague on this...

Cheers
 Andy Stratton
8  Java Game APIs & Engines / Xith3D Forums / Re: Good Geometry editors for Xith3D? on: 2005-04-16 07:23:55
Thanks for the info everyone. Thought it might be useful to summarize what I found out.

I should point out that I am a Java expert (web professional-technical architect) but not a 3d person or games person (yet:). So please excuse my 3d ignorance...

My choice of editor is now going to be Art of Illusion. Basically I had  it working with the obj loader (from newdawn) before I got anywhere with anything else.

From what I could see, blender looks excellent, but requires a big investment in learning it's unique interface. Plus it depends on python for ase export (and other scripts). I gave up very quickly after failing to get it to recognise python. This was purely impatience on my behalf.

I will be following up with some questions about some of the issues with aoi - but they need to be in a new thread.

Cheers
 Andy Stratton
9  Java Game APIs & Engines / Xith3D Forums / Good Geometry editors for Xith3D? on: 2005-04-14 06:50:02
This is just a quick request for any recommendations on editors for creating xith3d content.  Preferably Free!

I'll start the ball rolling with some of my experience:


Art of Illusion (Free)
==============
Seems great, though you have to render to see materials.  You can export as Obj (and use newdawn objloader to load into Xith3D). However, loads as a BranchGroup - and I don't know how to change the Appearance Smiley
--Also saves as vrml - but haven't tried this yet.

GMax (Freeish)
===========
Seems very good - but doesn't export to a format I can load in Xith3d.
--Anyone know of a suitable loader?

MilkShape 3D (30 day shareware)
========================
Haven't tried this yet. Quite cheap (only 17 pounds).
--anyone have success with this?
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

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

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

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

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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!