• Create Account

## 3d vector rotation

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1IStrikerI  Members

122
Like
Likes
Like

Posted 24 August 2001 - 05:43 AM

how can i rotate a vector by a certain amount of degrees ? is it possible or do i have to rotate the vector by a matrix ?

### #2lightwave  Members

122
Like
Likes
Like

Posted 26 August 2001 - 06:39 AM

this was done for a java applet the formula is fine if i could only get the damn kinks out of the rest of the applet
here xa,ya,za is the point of the vertice loades in from a array 1 at a time hope it helps

Xa=Xp[vv][v];
Ya=Yp[vv][v];
Za=Zp[vv][v];

// improvised on the rotation formula because
// all the examples for simultaneous operations were for matrixes only
// this is a simultaneous operation on all 3 axis without a matrix

//System.out.println( "*********x*y*z*rotating on the axis''es" );
// rotate on the z axis

// rotate on the x axis

// rotate on the y axis

// place into temp array for drawing manipulation
// add a screen offset so its not spining around coordinates 0,0 x y
Xtemp[v] = Xb+off_set;
Ytemp[v] = Yb+off_set;
Ztemp[v] = Zb;

### #3lightwave  Members

122
Like
Likes
Like

Posted 26 August 2001 - 06:42 AM

btw
it use radians math.pi is just pie

double radiansZ = ( Math.PI * degreesZ )/180;
double radiansX = ( Math.PI * degreesX )/180;
double radiansY = ( Math.PI * degreesY )/180;

### #4lightwave  Members

122
Like
Likes
Like

Posted 26 August 2001 - 06:52 AM

one more thing im gonna post the entire code in the java
programing forum if anyone can help me figure out why the heck
this applet cause the error it cause plz help no one in the sun forums has a answer

### #5IStrikerI  Members

122
Like
Likes
Like

Posted 26 August 2001 - 11:36 AM

thx !!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.