Yes, it is possible.
In fact I wrote some code to work out how co-ordinates change after rotation. Here's the useful bits:
Code:
class Vector
{
float x,y,z;
float nx,ny,nz;
float mag;
Vector(float _x, float _y, float _z)
{
x=_x;
y=_y;
z=_z;
//calculate the normalised vector (vector of length 1)
//.. doesn't make sense for using vector for co-ords,
//but useful when an actual vector
mag=sqrt(x*x+y*y+z*z);
nx=x/mag;
ny=y/mag;
nz=z/mag;
}
}
Vector rotateX(Vector a,float ang)
{
float mz=a.z*cos(ang)+a.y*sin(ang);
float my=a.y*cos(ang)-a.z*sin(ang);
return new Vector(a.x,my,mz);
}
Vector rotateY(Vector a,float ang)
{
float mz=a.z*cos(ang)-a.x*sin(ang);
float mx=a.x*cos(ang)+a.z*sin(ang);
return new Vector(mx,a.y,mz);
}
Vector rotateZ(Vector a,float ang)
{
float mx=a.x*cos(ang)-a.y*sin(ang);
float my=a.y*cos(ang)+a.x*sin(ang);
return new Vector(mx,my,a.z);
}
And to use it:
Code:
Vector p=new Vector(50,20,-50);
p=rotateX(p,HALF_PI);
p=rotateY(p,-0.854);
println("Vector P, x:"+p.x+", y:"+p.y+" z:"+p.z);
I think this should work. I've only used it with normalised vectors, not absolute co-ordinates. But I don't see why it shouldn't work.