Rotation degrees help

This is not returning what you think it is. Unless you think it’s returning a magical number that is not useful on its own… then yes, that’s what it’s returning.

Please stop thinking that the values of a Quaternion are useful individually or human-readable in some way. They aren’t. For the sake of this discussion, Quaternions are magic black boxes. You don’t need to know how they work to use them.

:smiley:

:frowning: I still cant finde how to :frowning: exactly

Yes, well, I still don’t understand what you are trying to do. I already gave steering hints and if that’s not it then you either have to explain better or stumble along, I guess.

Edit: changed “steering examples” to “steering hints” as there are plenty of examples that extrapolate on using the dot product for steering so I didn’t expand on that beyond the hint based on the example I provided.

    private void updateModels(Set<Entity> entities) {
        entities.stream().forEach((e) -> {
            Direction direction = e.get(Direction.class);
            Quaternion rotation = new Quaternion();
            rotation.lookAt(direction.getDirection(), Vector3f.UNIT_Y);
            ed.setComponents(e.getId(), new Rotation(rotation));
        });
    }

And my visual state is then applying it to the model(s)


    private void updateVisible(Entity e, Node node) {
        node.setLocalTranslation(e.get(Position.class).getLocation());
        node.setLocalRotation(e.get(Rotation.class).getRotation());
    }

Maybe that helps you to get an idea? So I basically use lookAt and the direction and up vector. That’s it. Or isn’t that requested in your case? Do you have test code to see what you are doing/trying?

i have
ship.move(Xtpf,Ytpf,Ztpf); on the top of my movement/navigation/avoid stuck,hit…
now the only thing i need is to SET DIRECTION to "ship"not immediatly,but just slowly like 3-4 cm at second tpf i suppose
then GET ship direction X Y Z and set them to ship.move(X
tpf,Y
tpf,Ztpf);
soo ship does not move to where it need to, but move to where ship is looking and ship will look
(after some time )to where it need to go.
Now if i get X Y Z of ship direction i should easily convert them in right proportion of .move(X
tpf,Ytpf,Ztpf); and eventually add maximal speed and acceleration with time.

It helps thnx ,i still need to check it better (and try to study how it works) but it still helps to get some idea ,thnx :slight_smile: