Moving Imported Model

I imported a model from blender using the script on the wiki, and that code to read the xml file. The model was attached to node "modelNode". How can i move the model? "setLocalTranslation(Vector3f)" doesnt work here. How do i do rotations? Will i use Quaternions?

thank you in advance


"setLocalTranslation(Vector3f)" doesnt work here


That's how it works though.. what exactly are you doing?

     protected void simpleInitGame() {
        display.setTitle("Ball Thing");
       
        String XMLFileName = "Monkey.xml";
        URL modelURL = this.getClass().getClassLoader().getResource(XMLFileName);
        XMLtoBinary converter = new XMLtoBinary();
        JmeBinaryReader jbr = new JmeBinaryReader();
        jbr.setProperty("bound", "box");
        ByteArrayOutputStream BO = new ByteArrayOutputStream();
        Node modelNode = null;
        try {
            converter.sendXMLtoBinary(modelURL.openStream(), BO);
            modelNode = jbr.loadBinaryFormat(new ByteArrayInputStream(BO.toByteArray()));
        } catch (IOException ex) {
            ex.printStackTrace();
        }
       


        modelNode.setLocalTransaltion(new Vector3f(0,0,-10));

      
        rootNode.attachChild(modelNode);
     }



Heres my code. It says that setLocalTranslation is undefined for type Node. Should I put the model into a Trimesh? If so, how?
Thank you.

I says setLocalTransaltion is undefined, I think.



Aren't you using some kind of IDE? That'll make it a bit easier to avoid typos like this…

Which IDE would you reccomend? I only know of Eclipse, JCreator, and Netbeans. Which one is best? (for this at least)

Well, can't say much about the others (only used NetBeans a long while ago). But Eclipse will tell you when you make mistakes like that as you are typing… without even having to compile. Both netbeans and eclipse will also give you a list of the methods you can use for an object while typing.



Most people here use Eclipse, Netbeans or jIDEA.

From what you say, I think I'll try eclipse. I havent used that, thought i have used netbeans a little. I'll install it today.



Thank you for the help and comments!

modelNode.setLocalTransaltion(new Vector3f(0,0,-10));



really, an IDE would help  :wink:

sfera said:

modelNode.setLocalTransaltion(new Vector3f(0,0,-10));

really, an IDE would help  ;)

IDEs are for wimps 

Though surprising hard to refute. 

I'm a wimp and I'm ok with that.



Eclipse and Netbeans are both good IDEs. I usually prefer Netbeans as I find Eclipse a little harder to set projects up. Netbeans functions more like the IDEs of yore, such as Visual Studio. I'm still very much a Java newbie though!

stodge said:

Netbeans functions more like the IDEs of yore, such as Visual Studio.


like visual studio? yuck!  :-o i have to work with that awful ide(or whatever it aims to be) every day, and it manages to drive me crazy each time.
i wanted to give a try to netbeans these days, but you just ruined it :P

now come on! you didn't really thought i took that seriously :wink:

sfera said:

now come on! you didn't really thought i took that seriously ;)

Who would be mad enough to take me serious, anyways?  :P