Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
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] 2
1  Java Game APIs & Engines / Xith3D Forums / Re: Rotation about a node, another problem... on: 2006-06-01 13:55:22
Thanks, I haven't got it at that phase yet, I'll have to see if I can do the effort Wink
2  Java Game APIs & Engines / Xith3D Forums / Rotation about a node, another problem... on: 2006-05-26 07:38:17
I got a camera rotation code that is a little jerky. The camera is "shaking" as it rotates.
It is so slight that you cant notice it unless you are close to the object you are rotating about.
The shaking also moves the view a very small amount in a direction that is equal to an axis
shooting out from the object's parent transformgroup origin towards the object.
The shaking i could almost live with but not the gradual unwanted translation that will eventually move the
camera right trough the object if facing it from the "front" side.
If facing it from the "back" the camera is moved away from the object.
So it's really simply translating along an axis shooting from the objects parent transformgroup right trough the object.
If facing it from the side there seems to be no translation but maybe it just cant be detected from that perspective.

I previously had a rotation code that didnt have this side effect but on the other hand had other bugs.

What i try to do and how im thinking of the rotation is as follows:

1) Move the camera (view) to the virtual world origin.
2) Move further to the object that i want to rotate about.
3) Make the rotation
4) Move back from the rotation center.
5) Move back from virtual world origin.

The following code has a simplified version for just rotating about the virtual world origin
and then the "full" version about an object.

In the code the following variables explained:

m_root --> BranchGroup, root of the scengraph.
m_view --> View, the view.
m_nodeSelected --> Node, pointer to a node that has been selected.

There is also the old rotation code commented out that doesnt have the shake
but doesnt account for everything properly (weird rotation).


   /**
    * Rotates the camera about the selected node.<br>
    * Direction of the rotation is taken from <code>x</code> and <code>y</code>.
    *
    * @param x
    * @param y
    */
   public void rotateCameraAboutSelectedNode(float x, float y) {
      Transform3D rotationLocation = new Transform3D();
      Transform3D cameraLocation = new Transform3D();
      Transform3D traslateLocation = new Transform3D();
      Matrix3f rotation1 = new Matrix3f();
      Matrix3f rotation2 = new Matrix3f();
      
      // Determine camera location
      m_view.getTransform(cameraLocation);

      // Determine rotation point (node or vworld)
      if (m_nodeSelected == null) {
         // for rotating about origo this works
         m_root.getLocalToVworld(rotationLocation);

         // "invert" -> transform to origin
         cameraLocation.invert();
         // make a rotation
         rotation1.setIdentity();
         rotation2.rotX(y / 100.0f);
         rotation1.mul(rotation2);
         rotation2.rotY(x / 100.0f);
         rotation1.mul(rotation2);
         // multiply with current rotation
         cameraLocation.getRotation(rotation2);
         rotation1.mul(rotation2);
         rotation1.normalize();
         // set new rotation
         cameraLocation.setRotation(rotation1);
         // "invert" -> transform back from origin
         cameraLocation.invert();
         
         /* // <-- this is the old rotation
         // rotate
         rotation1.setIdentity();

         rotation2.rotX(y / 100.0f);
         rotation1.mul(rotation2);
         rotation2.rotY(x / 100.0f);
         rotation1.mul(rotation2);
         
         rotationLocation.setRotation(rotation1);
         rotationLocation.mul(cameraLocation);         
         // set new camera transform
         cameraLocation.set(rotationLocation);
         */

      }
      else
      {

(This is where to look for the bug...)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
         // for rotating about something else than origo we need slight
         // modifications to rotation code
         m_root.getLocalToVworld(rotationLocation);
         m_nodeSelected.getLocalToVworld(traslateLocation);
         
         
         // "invert" -> transform to origin
         cameraLocation.invert();
         // transform to rotation center
         cameraLocation.mul(traslateLocation);
         // make a rotation
         rotation1.setIdentity();
         rotation2.rotX(y / 100.0f);
         rotation1.mul(rotation2);
         rotation2.rotY(x / 100.0f);
         rotation1.mul(rotation2);
         // multiply with current camera rotation
         cameraLocation.getRotation(rotation2);
         rotation1.mul(rotation2);
         rotation1.normalize();
         // set new rotation
         cameraLocation.setRotation(rotation1);
         // transform away from rotation center
         traslateLocation.invert();
         cameraLocation.mul(traslateLocation);
         // "invert" -> transform back from origin
         cameraLocation.invert();



         /* // <-- old rotation code
         // translate to rotation point
         rotationLocation.mul(traslateLocation);
         // rotate
         rotation1.setIdentity();
         rotation2.rotX(y / 100.0f);
         rotation1.mul(rotation2);
         rotation2.rotY(x / 100.0f);
         rotation1.mul(rotation2);
         rotation1.normalize();
         rotationLocation.setRotation(rotation1);
         // translate away from rotation point
         traslateLocation.invert();
         rotationLocation.mul(traslateLocation);
         rotationLocation.mul(cameraLocation);
         // set new camera transform
         cameraLocation.set(rotationLocation);*/
      }

      try {
         m_view.setTransform(cameraLocation);
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
   
If you can spot the bug or point out any other mistakes like fundamentally wrong use of matrices, please help.
3  Java Game APIs & Engines / Xith3D Forums / Re: Small Gui System (SGS for short) for Xith on: 2006-05-15 12:27:59
Im sorry i still have been pretty busy.. Sad
Its better that i dont promise anything at the current but well see...
4  Java Game APIs & Engines / Xith3D Forums / Re: Small Gui System (SGS for short) for Xith on: 2006-05-05 07:59:19
Well, I was 2 months traveling and recently came back. Now i havent restarted yet with it but i can share what i have - i only have to separate it from my other project first.
I'll come back on this with a post when I have done that.
5  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-03-12 07:09:02
I just committed a test program to this. Basically it just mixes parallel and perspective by rendering a cube in each mode. The cubes are rotating so that the difference can be seen.

I'll continue maintaining this so feel free to suggest improvements, other requests and of course notify bugs.

For now im leaving this as it is and head back to finalize the GUI system im working on...

Jaakko
6  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-02-27 23:28:13
Committed.

A test program will follow soon...
7  Java Game APIs & Engines / Xith3D Forums / Re: New Xith3D-core Developer on: 2006-02-22 23:50:58
Congratulatons!
8  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-02-22 23:49:06
Ok, i tought i was at developer status but well then.. Thanks for adding me!

Sorry for my recent absence but i relocated to San Francisco last week for a six weeks assignment by my company ( to learn J2ME to BREW porting Smiley ) and im getting over the jetlag slowly. I will commit the package as soon as possible - when im fully recovered and not falling asleep at once when entering my hotel room.
9  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-02-13 21:24:22
The server reported an error while performing the "cvs add" command.
  xith-tk: User jaakko777 doesn't have <VersionControl - Add> access to project xith-tk
10  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-02-12 21:41:13
Still cant add... Sad

I'll make a complete example when i can commit properly, unitll that here is a quick incomplete example:



// create the render peer
renderPeer = new RenderPeerImpl();
canvasPeerImpl = (CanvasPeerImpl) renderPeer.makeCanvas(frame, frame.getWidth(), frame.getHeight(), graphicsMode.getBitDepth(), graphicsDevice.getFullScreenWindow() != null);
canvas3d = new Canvas3D();
canvas3d.set3DPeer(canvasPeer);

// create the virtual universe
virtualUniverse = new VirtualUniverse();

// create a locale for the universe
locale = new Locale();
virtualUniverse.addLocale(locale);

// create a view for the universe
view = new MultiPassView(canvasPeer, locale);

virtualUniverse.addView(view);

// This far all looks pretty normal, but now comes the multiview setup

RenderPass background = new RenderPass(View.PERSPECTIVE_PROJECTION, 0.1f, 10.0f, new Background(new Color3f(0,0,0)));
view.addRenderPass(background);

RenderPass scene = new RenderPass(View.PERSPECTIVE_PROJECTION, 0.1f, 3000.0f, new BranchGroup(), RenderPass.ALIGN_Z_CLOSEST);
view.addRenderPass(scene);

RenderPass hud = new RenderPass(View.PARALLEL_PROJECTION, 0.1f, 100.0f, new Foreground(new BranchGroup(), View.VIEW_FIXED), RenderPass.ALIGN_Z_CLOSEST);
view.addRenderPass("gui", hud); // <-- Note that we add a name for this pass so that we can refer to it easily later

// add the canvas to the view
view.addCanvas3D(canvas3d);

// the render loop
while(true) {
   // Any scenegraphg updates
   ...
   // for example:
   // Node gui = view.getRenderPass("gui").getNode();
   // do something with the gui, update for example a FPS counter
   ...
   
   // render in multi pass
   view.renderAll();
}
11  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-02-12 10:06:59
Ok, thanks. Ill try it tonight.
12  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-02-10 00:36:01
I tried to add the package to the toolkit but i dont have 'Add' rights to the project.
Id like to have a folder named org.xith3d.multipass.

I tested that the tookit builds fine with the ant build and javadoced the sources.
I still have to write the package level javadoc description and a test program.

Anyway here is the whole package...
13  Java Game APIs & Engines / Xith3D Forums / Re: about updateData on: 2006-02-09 07:39:00
Im not sure about how the update should/could be made but have you tried the GeomDataInterface for setting the floats in the geometry.
If you check this http://xith.org/tutes/GettingStarted/html/more_fun_with_textures.html tutorial you see how its done in that way.
Its updating textureCoordinates, but im sure it works for all geometry data, at least all that i have tried ( coordinates, colors ).

So i geuss that instead of doing this

//point
geom[TMPsurff].setCoordinate((ff*3)+2,
new Point3f(
((float[])(((ArrayList)listOfSurff.get(TMPsurff)).get(TMPfaces[TMPsurff][ff][0])))[0],
((float[])(((ArrayList)listOfSurff.get(TMPsurff)).get(TMPfaces[TMPsurff][ff][0])))[1],
((float[])(((ArrayList)listOfSurff.get(TMPsurff)).get(TMPfaces[TMPsurff][ff][0])))[2]));

geom[TMPsurff].setCoordinate((ff*3)+1,...

geom[TMPsurff].setCoordinate((ff*3)+0,...
...

you could try doing this

//point
GeomDataInterface coords = ((GeometryArray)geom[TMPsurff]).getCoordinateData(0);
coords.setFloats((ff*3)+6,
((float[])(((ArrayList)listOfSurff.get(TMPsurff)).get(TMPfaces[TMPsurff][ff][0])))[0],
((float[])(((ArrayList)listOfSurff.get(TMPsurff)).get(TMPfaces[TMPsurff][ff][0])))[1],
((float[])(((ArrayList)listOfSurff.get(TMPsurff)).get(TMPfaces[TMPsurff][ff][0])))[2]);

coords.setFloats((ff*3)+3,...

coords.setFloats((ff*3)+0,...
...


Hope it works Smiley
14  Java Game APIs & Engines / Xith3D Forums / Re: Small Gui System (SGS for short) for Xith on: 2006-02-06 23:20:39
Here is a screenshot, although its not intended to be pretty yet, you can see that it actually does work Tongue

There are some more stuff visible since from my last post; the button and a "panel" showing the wireframe of a shape from the scene selected by picking.

[size=8pt]Edit: Dont pay attention to the FPS of 77. That has nothing to do with the gui but with the scene... It's ~750 without the scene and only the gui.[/size]
15  Java Game APIs & Engines / Xith3D Forums / Re: Small Gui System (SGS for short) for Xith on: 2006-02-06 09:51:53
Some update from my progress:

I have a very well working system for the basis of any kind of gui. I have made two abstract classes (component and container) that are capable of handling the positioning, sizing, and such. Infact they handle everything exept two things that they require a subclass to implement; first they need to provide a method returning a node that will be used to render the component, second they need to provide a geometryUpdater method that can handle updating the geometries in the node it provided. Both can be left empty, of course you wouldnt want to leave the first one empty, if you leave the latter empty then the component will not be able to for example resize should it be needed.

In addition to those two forming the base of the system i have extended one container (UIPanel) and one component (FPSCounter). In the FPSCounter i used the DText2D class from the toolkit but i had to do a lot of customization so i might have to make a new one (maybe UIText) just for the gui.

Last night i squeezed in one more thing; support for layout managers. I made the interface and implemented a swinglike GridLayout. Im still just beginning to think about the layoutmanagers so ill elaborate on that when i know im doing it the right way (maybe taking a peek at awt sources Cheesy).

Oh, i almost forgot; the gui is interactable by implementing a listener on your topmost gui container and then delivering events from your input layer. The methods return boolen so you can know weather the gui "consumed" the event or was it targeted at the scenegraph. The components are currently draggable and clickable, and some attributes can be defined to them that changes the behaviour they react to these events: they can be draggable or not draggable, they can cross the screen borders or not cross, they can dock to the screen borders or not dock, they can be auto resizing or not.

Lastly, using the multipass rendering the screen scale is set relative to that of the screen pixel size (for a 800x600 window the screen scale is set to 400) in the pass when rendering the gui. This enables to position and size the components in pixel scale. This also enables the gui components to remain of constant pixel size even if the window is resized. I made the first prototype without this feature, it worked fine but i had to do a lot of extra computing to get the locations right and the components were also resized when the window resized. Maybe i will provide both options.

Ill clean up the code, javadoc it and post some screens next.  Wink
16  Java Game APIs & Engines / Xith3D Forums / Re: Small Gui System (SGS for short) for Xith on: 2006-01-31 13:44:07
Whats your progress <MagicSpark.org [ BlueSky ]>?
Communication has been almost zero between us during the project, and as a matter of fact all that there is is on this forum...   Undecided
I have progressed to a good start on my behalf and now i wonder weather to recheck and try to bring up some cooperation or should i just burn more gas and head on out finishing one GUI system by myself.
I dont really mind working alone, infact i prefer now that since i feel that i have formed a good start by myself and feel confident in developing it alone and the way that i want it to be.

Do you have any comments on this before i start my own thread about it?

 Smiley Cheers,
17  Java Game APIs & Engines / Xith3D Forums / Re: rotation question on: 2006-01-27 16:20:38
Dunno if this thread is still "alive" but there is a neat function i made for doing that.
It rotates about a Node but you can easily extract the relevant parts of it to suit your needs.


   public BrachGroup rootBG; // <-- The root of your scenegraph...

   /**
    * Rotates the camera about the selected node.
    *
    * If <code>node</code> is null then rotation will be performed about the VirtualWorld origo.
    * Direction of the rotation is taken from <code>x</code> and <code>y</code>.
    *
    * @param camera
    * @param node
    * @param x
    * @param y
    */
   public void rotateCameraAboutNode(View camera, Node node, float x, float y) {
      Transform3D rotationLocation = new Transform3D();
      Transform3D cameraLocation = new Transform3D();
      Transform3D traslateLocation = new Transform3D();
      Matrix3f rotation1 = new Matrix3f();
      Matrix3f rotation2 = new Matrix3f();
      
      // Determine camera location
      camera.getTransform(cameraLocation);

      // Determine rotation point (node or vworld)
      if (node == null) {
         // for rotating about origo this works
         rootBG.getLocalToVworld(rotationLocation); // <-- rootBG is your scenegraph root

         // rotate
         rotation1.setIdentity();
         rotation2.rotX(y / 100.0f);
         rotation1.mul(rotation2);
         rotation2.rotY(x / 100.0f);
         rotation1.mul(rotation2);
         rotationLocation.setRotation(rotation1);
         rotationLocation.mul(cameraLocation);
         // set new camera transform
         cameraLocation.set(rotationLocation);
      } else {
         // for rotating about something else than origo we need slight
         // modifications to rotation code
         rootBG.getLocalToVworld(rotationLocation);
         node.getLocalToVworld(traslateLocation);

         // translate to rotation point
         rotationLocation.mul(traslateLocation);
         // rotate
         rotation1.setIdentity();
         rotation2.rotX(y / 100.0f);
         rotation1.mul(rotation2);
         rotation2.rotY(x / 100.0f);
         rotation1.mul(rotation2);
         rotation1.normalize();
         rotationLocation.setRotation(rotation1);
         // translate away from rotation point
         traslateLocation.invert();
         rotationLocation.mul(traslateLocation);
         rotationLocation.mul(cameraLocation);
         // set new camera transform
         cameraLocation.set(rotationLocation);
      }


      // In Java3D the transform sometimes got non-congruent but that hasnt happened in Xith3D.. Is it normalized in the xith core Huh
      // the transform gets non-congruent so often that we might as well
      // normalize it every time
      // cameraLocation.normalize();

      try {
         camera.setTransform(cameraLocation);
      } catch (Exception e) {
         e.printStackTrace();
      }
   }



Note that this rotation will be applied as if the x and y parameters were in the node's coordinate space.
I guess it would require a quaternion rotation to get it work right in all cases, but that is something that is still beyond my comprehension...
18  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-01-26 10:57:31
How would org.xith3d.scenegraph.MultiPassView and org.xith3d.scenegraph.RenderPass be?

Or maybe just org.xith3d.multipass.*
19  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-01-26 09:40:15

As Yuri mentions in Issue #101, one thing you lose when using a Scenegraph is more direct control over the rendering, etc.

Depending on how you use your new MultiPassView class, you could have much more control over the render order which is nice.


I have been thinking about that too, and i came up with an idea which im not sure if it would work, but here it is:

Make a Node (I used extending from Group) that doesnt get drawn when its getting processed during render time. Instead it executes a code snippet provided by the programmer. I overided the getChildren() method so that it calls its own run() method -- containing the code you wanna execute in the middle of render time -- then it returns a empty ArrayList. I havent really tested this since im not so good at immediate mode rendering ( which i think this could be used to ). I guess it could be used for just about anything you usually would like to do in the midst of the rendering.
Does this sound like a awful hack? If it does, i better shut my mouth and keep the wild ones to my self... Cheesy
20  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-01-26 09:27:10
Ok, well ill add it to the toolkit now so i get it out, then you decide weather it will end up in the core.
I'll look into those subjects as i have done that.
21  Java Game APIs & Engines / Xith3D Forums / Re: Small Gui System (SGS for short) for Xith on: 2006-01-26 09:17:03
I agree it should be there..
I'll think about  the name a few more days.
22  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-01-26 05:15:40
Yeah, there are other nice things in 5.0. Like for example System.nanoTime() , a high resolution timer. Perfect for counting update times.
23  Java Game APIs & Engines / Xith3D Forums / Re: HOw to load a simple one group ASE file using getModel () on: 2006-01-26 05:12:45
I have not used the ASELoader but it looks like something is not initialized in the correct order.

Try moving the line where you get the model a few lines down the code so it looks like this:
      try
      {
         af = new AseFile();
         BufferedReader br = null;

         try
         {
            br = new BufferedReader(new FileReader("tri_leged.ASE"));
         }
         catch (IOException e)
         {
            URL url = this.getClass().getClassLoader().getResource("tri_leged.ASE");
            br = new BufferedReader(new InputStreamReader(url.openStream()));
         }

         AseReader r = new AseReader(br);
         af.parse(r);

         tri_legBG = af.getModel("tri_legged.ase");
      }

Atleast it looks a bit more like it could work...  Wink Then again i havent used the ASELoader so i dont know how its supposed to work.
24  Java Game APIs & Engines / Xith3D Forums / Re: MultiPassView - Can I add it as a package to xith.tk? on: 2006-01-25 15:33:11
Oh yeah you are right, I'll change that...
Also I noticed that there is potentially a NullPointerExeption thrown in the render() method.

Well, ill fix those and then, who do I need to get the "green light" from for committing the new package?
25  Java Game APIs & Engines / Xith3D Forums / MultiPassView - Can I add it as a package to xith.tk? on: 2006-01-25 00:25:01
I made these two classes for the multipass rendering that got spawned from this thread: http://www.java-gaming.org/forums/index.php?topic=10611.0

MultiPassView.java
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
import java.util.ArrayList;

import com.xith3d.render.jogl.*;
import com.xith3d.scenegraph.*;


public class MultiPassView extends View {
   private CanvasPeerImpl m_peerImpl;
   private ArrayList<RenderPass> m_renderPasses;
   private BranchGroup m_sceneGraph;
   
   public MultiPassView(CanvasPeerImpl peerImpl, Locale locale) {
      super();
      m_peerImpl = peerImpl;
      m_renderPasses = new ArrayList<RenderPass>(128);
      m_sceneGraph = new BranchGroup();
      m_sceneGraph.setPickable(true);
      locale.addBranchGraph(m_sceneGraph);  
   }
   
   public void addRenderPass(RenderPass pass) {
      if (m_renderPasses.size() == 0) {
         m_renderPasses.add(pass);
      } else {
         switch (pass.getZAlignment()) {
            default:
            case RenderPass.ALIGN_Z_FAR :
               m_renderPasses.add(0, pass);
               break;
            case RenderPass.ALIGN_Z_CLOSE :
               m_renderPasses.add(m_renderPasses.size() - 1, pass);
               break;
            case RenderPass.ALIGN_Z_CLOSEST :
               m_renderPasses.add(pass);
               break;
         }
      }

      m_sceneGraph.addChild(pass.getNode());
   }
   
   public void removeRenderPass(RenderPass pass) {
      int index = m_renderPasses.indexOf(pass);
      m_renderPasses.set(index, null);
      m_sceneGraph.removeChild(pass.getNode());
   }
   
   public void renderAll() {
      for (int i = 0; i < m_renderPasses.size(); i++) {
         
         // get render pass
         RenderPass pass = m_renderPasses.get(i);
         
         // set node
         pass.getNode().setRenderable(true);

         // set projection policy
         if (pass.getProjectionPolicy() == View.PARALLEL_PROJECTION) {
            setProjectionPolicy(View.PARALLEL_PROJECTION);
         } else {
            setProjectionPolicy(View.PERSPECTIVE_PROJECTION);
         }
         
         // set clear buffer state
         if (i == 0) {
            m_peerImpl.setDisableClearBuffer(false);
         } else {
            m_peerImpl.setDisableClearBuffer(true);
         }
         
         // set force swap state
         if (i < m_renderPasses.size() - 1) {
            m_peerImpl.setForceNoSwap(true);
         } else {
            m_peerImpl.setForceNoSwap(false);
         }
         
         // render
         renderOnce();
         
         // unset node
         pass.getNode().setRenderable(false);
      }
   }
}


and

RenderPass.java
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
import com.xith3d.scenegraph.Node;

/**
 * @author Jaakko
 *
 */

public class RenderPass {

   public static final int ALIGN_Z_FAR = 0;
   public static final int ALIGN_Z_CLOSE = 1;
   public static final int ALIGN_Z_CLOSEST = 2;

   private int m_projectionPolicy;
   private float m_nearClip;
   private float m_farClip;
   private Node m_node;
   private int m_zAlignment;
   
   /**
    *
    */

   public RenderPass(int projectionPolicy, float nearClip, float farClip, Node node) {
      this(projectionPolicy, nearClip, farClip, node, ALIGN_Z_CLOSE);
   }
   
   /**
    *
    */

   public RenderPass(int projectionPolicy, float nearClip, float farClip, Node node, int zAlignment) {
      m_projectionPolicy = projectionPolicy;
      m_nearClip = nearClip;
      m_farClip = farClip;
      m_node = node;
      m_zAlignment = zAlignment;
      m_node.setRenderable(false);
   }
   
   /**
    * @return Returns the zAlignment.
    */

   public int getZAlignment() {
      return m_zAlignment;
   }

   /**
    * @param alignment The zAlignment to set.
    */

   public void setZAlignment(int zAlignment) {
      m_zAlignment = zAlignment;
   }

   /**
    * @return Returns the farClip.
    */

   public float getFarClip() {
      return m_farClip;
   }
   
   /**
    * @param clip The farClip to set.
    */

   public void setFarClip(float clip) {
      m_farClip = clip;
   }
   
   /**
    * @return Returns the nearClip.
    */

   public float getNearClip() {
      return m_nearClip;
   }
   
   /**
    * @param clip The nearClip to set.
    */

   public void setNearClip(float clip) {
      m_nearClip = clip;
   }
   
   /**
    * @return Returns the node.
    */

   public Node getNode() {
      return m_node;
   }
   
   /**
    * @param m_node The node to set.
    */

   public void setNode(Node node) {
      m_node = node;
   }
   
   /**
    * @return Returns the projectionPolicy.
    */

   public int getProjectionPolicy() {
      return m_projectionPolicy;
   }
   
   /**
    * @param policy The projectionPolicy to set.
    */

   public void setProjectionPolicy(int policy) {
      m_projectionPolicy = policy;
   }
}


Now can I add them as a new package to the toolkit?
I'll provide good javadoc comments and make a test program as required.

Smiley
26  Java Game APIs & Engines / Xith3D Forums / Re: Xith toolkit role on: 2006-01-24 23:48:35
Hmm.. good points there, but then we are talking about features that will never end up in the xith core.
Well on the other hand, why would they need to...
27  Java Game APIs & Engines / Xith3D Forums / Re: Mixing parallel and perspective projection in the same frame on: 2006-01-24 23:42:14
It seems that by default in PARALLEL_PROJECTION the coordinate system is such that the edges of the screen on the x-axis are allways 1.0f and -1.0f.
It's quite practical from one point of view but what if i want to draw something on the screen that does not get resized if the screen is resized. Can the coordinate system be somehow made "ignorant" of the screen size?
28  Java Game APIs & Engines / Xith3D Forums / Re: Xith toolkit role on: 2006-01-24 23:11:21
Well I'm certainly still a nOOb around here but still I dare to say that the stuff in xith-tk should not be depending on any extra libraries/APIs.
In my opinion they should be allowed only to depend on other xith-tk packages and the standard Java API (like the swingui for example).
Ofcourse also jogl and lwjgl as xith itself depends on them!  Cheesy

Im not sure if this is what you asked, but thats my opinion about what should go there and what not...
29  Java Game APIs & Engines / Xith3D Forums / Re: 2D Overlay on 3D Rendering on: 2006-01-24 22:56:10
There is this quite recent thread that you might find useful: http://www.java-gaming.org/forums/index.php?topic=10611.0
30  Java Game APIs & Engines / Xith3D Forums / Re: Loading Terragen OBJ on: 2006-01-24 10:33:00
Obviously you're parsing an HTTP-header... why?
Please, download the obj and the mtl to the hard disk. Verify the obj donĀ“t have HTTP-header inserted by the web server.

Ok, so thats the problem, ill remove the header and test again Wink
Pages: [1] 2
 

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 (52 views)
2014-10-17 03:59:02

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

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

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

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

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

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

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

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

BurntPizza (85 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!