How to get any Normal of a Vector ? Vector3f.getNormal()

Hi again  :)

 How do you get any of the Normals of one Vector3f, assuming that's all you have: the vector ?

That is, one perpendicular vector (the normal) on that Vector3f

like, cam.getUp() is the Normal for cam.getDirection() [and the reverse is true too]

Clearly, to get a Normal you'd have to have a plane…

 I realize that you can get an infinite number of Normals for a vector and getting them all would form a filled circle or more even…

 So, if you have only the vector, and maybe you can have an idea which normal you want, for example, the one on the +Y axis… What I want to try to do with this is for example, when I shoot the bullet in I want it to wobble on the Y axis , no matter in which direction it is going which just now makes me realize that I could assume the wobbling should be on the cam.getUp() vector (stored somewhere at the point of creation)…

 Ok, so if I had that normal vector I would mult that with a variable going from -1f to 1f (for example) in time, and add that to the localTranslation pos of the bullet.

 But, I don't really want to limit myself to getting the cam.getUp() vector, I was kind of hoping that I could use some variable W to get any of the normals on my Vector3f based on that W. Maybe W could be an angle from 0 to 360 or something, where 0 would mean the normal that goes straight to the right on +X axis…

 Any thoughts on that? Ideas? Help. Anything would be much appreciated  :)

Edit: so far I found that if I use up=cam.getUp() everything works perfectly

however if I use instead,

up = direction.cross( Vector3f.UNIT_X );


It almost works, except sometimes the normal vector it reversed

Edit2: almost same thing with this:

Quaternion q = new Quaternion( direction.x, direction.y, direction.z, 0 );

up = q.getRotationColumn( 1 );

Edit3: I've been looking at how AbstractCamera does get the up vector (getUp()) but I'm having trouble understanding… sure initially the up vector is 0,1,0 but after that it depends on left and direction vectors or something like that. Basically if I could get the up vector for a vector which I would consider to be the Z axis, but for that I would also need to consider something the X axis (aka left vector) or have an angle from 0 to 360 instead.

Edit4: I ended up using cam.getUp() and cam.getLeft() for the vector cam.getDirection(). It works for what I wanted, although I was hoping for something more general, for any given vector , but for that I would need the Left vector to find the Up vector, and even if I had that, I still don't know how to find the Up vector  :slight_smile: