Archived

This topic is now archived and is closed to further replies.

bonespiritd2

Dragging objects in 3D

Recommended Posts

Hi, I am trying to do something really simple. Let''s say you have a cube drawn on the screen and I am trying to be able the grab a corner of that cube and let''s say resize it. My problem is that I am getting incorrect coordinates from the system (using visual c++ 6), which I cannot really use and I guess there must be some algorithm to convert the coordinates I am getting to the coordinates I really need. I am kind of new here soe sorry if this question has been already answered (I looked through some of the posts and I couldn''t find anything). Thanks a lot.

Share this post


Link to post
Share on other sites
First of all, we need what coordinate system you are using? And what API are you using? There may be a simple function call that will do it for you.

And is your problem detecting where the click is occurring?

Share this post


Link to post
Share on other sites
first of all, thanks for the reply...

well i am using windows api if that''s what you''re asking. i am writing it in visual c++ 6. but i woulnd''t mind converting it or using glut if it''s easier.

to be more specific what my problem is:
let''s say i have a function drawCube() with some preset parameters. then, a mouse cursor would be showing and you would be able click any of the cornerns which would call some other function to check if a corner was clicked. for that i need the position of the cursor when clicked and then throughout the time the cursor is moving. i was trying to do it in my WindowProc() fucntion to check for some kind of messages like WM_LBUTTONDOWN and/or WM_MOUSEMOVE but LOWORD(lParam) and HIWORD(lParam) give me coordinates like 240,548 and I need something like 1.3,0.7. I hope you know what I mean. As I said, if there is an easier way of doing it using glut I would like to hear that solution as well. Please let me know if I should be more specific on some of the things I mentioned.

THanks a bunch!

Share this post


Link to post
Share on other sites