Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have to use this function to get a Surface of Revolution (homework).

newVertex = (oldVertex.y, someFunc1(oldVertex.x, oldVertex.y), someFunc2(oldVertex.x, oldVertex.y));

As far as I know (FIXME) Surface of Revolution means rotations of a (2D)curve around an axis in 3D. But this vertex computing gives a 3D plane (FIXME again :D), so rotation of this isn't obvious.

Am I misunderstanding something?

share|improve this question
    
Not quite sure what the question is exactly, but a 'Surface of Revolution' is also known as 3D Lathe. Here is an interactive demo - fisme.uu.nl/toepassingen/00182/toepassing_wisweb.en.html –  DrDeth Apr 16 '11 at 15:04
    
Its a 2D curve rotated around the X axis. But this function is not a 2D curve. –  user5584 Apr 16 '11 at 15:55
3  
This is not Game Development. –  AttackingHobo May 18 '11 at 3:07
add comment

1 Answer

I guess the 2D "curve" is given as a polyline with oldVertex vertices. Rotating the curve around an axis should result in appropriate 3D vertices where each old vertex creates a loop of new vertices given an angle-step.

The other possibility I imaging is rotating given 3D vertices according to their x/y components, ignoring z. That would involve some dot- and crossproducts but you example code doesn't make a lot of sense in that case.

Are you sure you got all those x/y/z parts right?

share|improve this answer
    
Yeah, I have X, Y, Y; But I still don't understand what to do. The mentioned function is not a curve. Its a shader used on a plane's vertices. No idai, where to do a rotation. –  user5584 Apr 16 '11 at 22:07
1  
Oh I got it. I don't have to rotate to begin with. –  user5584 Apr 17 '11 at 15:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.