I am rotating my camera using GlRotatef which works fine, but once I have rotated how do I get the new coordinates?, same goes for objects...

thanks

Marc

03-02-2000, 05:00 AM

I don't know, but I'm also very interested in it. If you find/get an answer, please let me know.

Thx

03-02-2000, 05:16 AM

Hi !
I`m working on a project that enables 3d navigation in a closed box.
I`ve created a class called camera and it is responsible for the rotation , and the different moves of the camera
if you think it is suitable for you !!

David

03-02-2000, 05:25 AM

gvilir - Yes that would be great, if you could post it here or mail it, thanks.

Marc, once I find out I'll tell you!, post me your mail address.

Hude

03-02-2000, 09:20 PM

It's not possible to get those transformed coordinates in OpenGL.
Just think the hardware case, how on earth could you access the data on the cards pipeline?
Or using several glVertex calls. IF there was some glGetTransformedVertex function, you should call it after each glVertex call. Doesn't sound too nice.
I think it could be possible to make this with some kind of vertex array extension where you can pass OpenGL source and destination arrays. But afaik there is now such thing...

03-02-2000, 09:34 PM

Hi david !
it seems that your email adress is wrong or something like this .

Marc

03-02-2000, 11:05 PM

David, my e-mail-address is available in the profiles-section (left one of the four icons on top of postings of registered contributors). But here it is, too:
m.schneider@oe.uni-duisburg.de

thx for your offer

Hude

03-03-2000, 11:44 PM

Just thought about something...

You could use glProject, but it's not a very good solution...

Antoche

03-04-2000, 01:40 PM

I can't believe what I saw ! Of course you can get the final coordinates of your points ! Have you ever heard of feedback mode ???
Antoche

Hude

03-05-2000, 10:28 PM

Doh, the problem is that you can't render while in feedback mode! So, you would have to switch into feedback mode, do the stuff you like, switch back to render mode...

Oh yes, and it's in window coordinates.

[This message has been edited by Hude (edited 03-05-2000).]

David

03-06-2000, 02:07 AM

gvilar, try this email echelonnine@hotmail.com

Everyone - thanks for replying, useful stuff.

Antoche

03-06-2000, 02:39 AM

>Doh, the problem is that you can't render >while in feedback mode! So, you would have >to switch into feedback mode, do the stuff >you like, switch back to render mode...
>Oh yes, and it's in window coordinates.

If you use glOrtho with window aligned to wolrd axes, then you get absolute coordinates. And switching Rendering mode to get some ccordinates is still faster than calculating transformed coordinates with your own algorithms.
Antoche

Hude

03-06-2000, 03:45 AM

Yeah, and then you need to switch between those projections... but, what the heck... I think you're right http://www.opengl.org/discussion_boards/ubb/smile.gif

The speed issue though. If you provide your own transformations, they're done only once. If you use feedback and render mode, they're done twice.

Btw, where do you guys need this stuff? Isn't there any other way to solve the problem than get the transformed coordinates?

[This message has been edited by Hude (edited 03-06-2000).]

David

03-06-2000, 05:10 AM

The reason why I needed the coordinates is because after a translation or rotation I needed to know where the camera is. A particular problem is that i need to move an object left and right from the camera's point of view, no matter where the camera is pointing. I have managed to do it around the Y axis , but Im a bit stuck around the x and z axis.

Antoche

03-06-2000, 11:31 AM

Imagine a landscape. A tank is on this landscape, wich is not plane. So the tank follows the curve of the landscape to be more realistic (1 rotation with a random axe). Then the tank has a turret, wich can rotate upon an other axe (not necesseraly Y). Then on this turret, there is a cannon wich can rotate upon an other axe (not necesseraly X). And now, where is the end of the cannon ?
(you've 10 sec to answer, or you're dead http://www.opengl.org/discussion_boards/ubb/smile.gif)
Now i think you see why i need that, Hu ?

Something else, is it really faster to use feedback and render modes than provide your own transformations? Normally we don't need too many transformed vertices, so it wouldn't really be a speed issue, right?

(thinking about discarding own transformations and D3D support... http://www.opengl.org/discussion_boards/ubb/smile.gif )

[This message has been edited by Hude (edited 03-06-2000).]

dans

03-09-2000, 06:50 AM

Originally posted by Antoche:
Imagine a landscape. A tank is on this landscape, wich is not plane. So the tank follows the curve of the landscape to be more realistic (1 rotation with a random axe). Then the tank has a turret, wich can rotate upon an other axe (not necesseraly Y). Then on this turret, there is a cannon wich can rotate upon an other axe (not necesseraly X). And now, where is the end of the cannon ?
(you've 10 sec to answer, or you're dead http://www.opengl.org/discussion_boards/ubb/smile.gif)
Now i think you see why i need that, Hu ?