Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
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  
  Synchronizing of xith3d and odejava objects  (Read 1345 times)
0 Members and 1 Guest are viewing this topic.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Posted 2005-05-03 17:01:33 »

Hi

I came across having objects whose render-geometry is different from the bounds, because the bounds are much simpler. Because of these differences, the Positions of the objects weren't the same any more (espascially when having more xith-objects for one Odejava object), so I wasn't able to use Xith3DDisplayObject, so I wrote my own DisplayTransformable, which manages exactly that.

Is anybody interested in that code?

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #1 - Posted 2005-05-04 17:56:39 »

Yes, I'm interested.
I would include it in Gamma.
Request the Developer role in Gamma and I will approve it ASAP so you can apport your contributions ( if you want, of course ).

http://gamma.dev.java.net

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #2 - Posted 2005-05-04 19:58:25 »

I requested Developer role now, lets see ...
BTW Is there already content added to the cvs? ... it looks so empty

If anybody else is interested I could put a link here too, but I think it's better when such stuff is all at one place together.

:: JOODE :: Xith3d :: OdeJava ::
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2005-05-05 23:32:52 »

Can you use Xith3DDisplayObject if you encapsulate your geometry in a TG which moves it into the correct position?

That's what I do and it works well.  Perhaps your method may save a few matrix calculations though?

Please post the code, I'm interested in seeing it.

Will.

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #4 - Posted 2005-05-06 07:40:11 »

It's actually not much(It's what a transformGroup would be doing anyways), so here is it:
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  
public class DisplaySync implements DisplayTransformable {
    Matrix4f diff;
    Matrix4f temp;
    TransformGroup g;
    Transform3D t;
    /** Creates a new instance of DisplaySync */
    public DisplaySync(TransformGroup g, Placeable p) {
        this.g = g;
        t = g.getTransform();
        diff = new Matrix4f();
        temp = new Matrix4f();
        t.get(temp);
        //GeomTransform's Quaternion  doesn't initialize correctly -  so something special here
       if(p instanceof GeomTransform) {
            diff = new Matrix4f();
            ((GeomTransform) p).getTransform(diff);
        }
        else diff.set(p.getQuaternion(), p.getPosition(),1);
        diff.invert();
        diff.mul(temp);
    }

    public void setTransform(Vector3f position, Quat4f quaternion) {
        temp.set(quaternion, position, 1);
        temp.mul(diff);
        t.set(temp);
        g.setTransform(t);
    }
   
}



:: JOODE :: Xith3d :: OdeJava ::
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #5 - Posted 2005-05-07 01:24:54 »

So is this better than encapsulating the geom inside a TG with the offset?

Will.

Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #6 - Posted 2005-05-07 09:12:43 »

yeah - I'd say so, cause you don't have to create a new tg. And people without very much Matrix knowledge could get proplems there. Please note, that the GeomTransform "Bug" is also work-rounded, here. From the performance side, I think there is no difference.

:: JOODE :: Xith3d :: OdeJava ::
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 (28 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (195 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!