Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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  
  Geomtransforms, don't work ?  (Read 1104 times)
0 Members and 1 Guest are viewing this topic.
Offline NewbTon

Junior Member




Odejava games rock!


« Posted 2005-03-22 03:13:23 »

I use them as described in the manual. But when I try to read the position from the body, all it returns is  a vector with the values  {NaN,NaN,Nan} If someone has a working example
with geomtranforms I'd really appreciate to see them..

Heres my code, what do I do wrong ?
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
 //create geom box
    box = new GeomBox("geombox:"+getName(),bxs,bys,bzs);
    //create geomtransform
   geomTransform = new GeomTransform("geomtransform:"+getName());
    //set geom for geomtransfrom
   geomTransform.setEncapsulatedGeom(box);
    //Create body
   body = new Body(name,world);
    //get position and rotation to be used for this body, as stated in the Transform3d object (tr)
   Vector3f pos = new Vector3f();
    tr.get(pos);
    Matrix3f m = new Matrix3f();
    tr.get(m);
    //set position and rotation of body
   body.setPosition(pos);
    body.setRotation(m);
    //set geom
   body.setGeom(geomTransform);
    //set mass parameters
   body.adjustMass(mass);
Offline arne

Senior Member




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


« Reply #1 - Posted 2005-03-22 11:26:13 »

Heck!!! I got the same thing, but with rotations!!!
see:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=physics;action=display;num=1111337078

:: JOODE :: Xith3d :: OdeJava ::
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #2 - Posted 2005-03-22 11:34:21 »

Just looked at your code, dont get whats wrong. I mean you didnt even  START your simulation at that point and still..
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arne

Senior Member




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


« Reply #3 - Posted 2005-03-22 11:43:46 »

It seems to me, that you're problem is mine in blue - i use rotations, you use positions, in both cases we get those NaN values.

I think if we got a solution - the solution works for both.
Have you tried the advice Will gave me?

:: JOODE :: Xith3d :: OdeJava ::
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #4 - Posted 2005-03-22 16:49:58 »

Quote
It seems to me, that you're problem is mine in blue - i use rotations, you use positions, in both cases we get those NaN values.

I think if we got a solution - the solution works for both.
Have you tried the advice Will gave me?


I'm sure if you calll getPosition and I call getRotation we will both get NaN's . I tried his suggestion, didnt work. I tried everything, calling getPosition on the enclosed geom, on the body, on the GeomTransform. Everything.  Changing the order  I calll methods, create the body before the GeomTransform, create it after, add Geomtransform to the body before I add the GeomBox to the GeomTransfrom and vice versa. I spent abount 8 hours trying different combinations.
According to the ODE docs it's very simple, so I just dont get it. Maybe it's because I use joint and jointAmotors to connect the bodies ? Should that cause any problems ?
Offline arne

Senior Member




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


« Reply #5 - Posted 2005-03-22 18:38:45 »

I don't know. Have you tried it as stand-alone code?

did you also try to set the position of the GeomTransform directly?

:: 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.

Pippogeek (40 views)
2014-09-24 16:13:29

Pippogeek (31 views)
2014-09-24 16:12:22

Pippogeek (21 views)
2014-09-24 16:12:06

Grunnt (47 views)
2014-09-23 14:38:19

radar3301 (29 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (43 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06

BurntPizza (55 views)
2014-09-19 03:14:18
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!