Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / A little understanding of dragging vertexes please!

Author
Message
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 7th Sep 2009 18:49
I am no noob, but this is such a noobish question it deserves to be in this board!

So heres what I'm doing.

Tag=1
I click a spot on an object (done with pick commands)
it stores the location of the click.
Tag=2
While Tag=1 and mousclick()=1
I get the location of the required vertexes and set them to the mouses location (not really, 3d pick vectors xyz)
If mouseclick()=0
Tag=0
endif

Basically that's it... what i want to know is why wont it work!

No object errors no errors at all... but no object dragging with the mouse either.

And while I'm at it might I add that I am also trying to figure out how to rotate the object with the pivot centered on the first area clicked (where the vertexes not following the mouse are) and rotate the vertexes depending on where the drag spot is (the mouse) so that it looks like a diagonal line rather than having obtuse angles at the end of the segment.

Anyone understand this willing to help? - I feel dumb!

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 8th Sep 2009 03:49
no one had any luck with this huh... think of it like drawing a 2d line with one end of the line on a fixed position and the other end of the line at the mouse's position. You drag it to the wanted location and release to make a line... now I need a 3d way to do this and because a line is only 1 px wide, no contradicting angle needs to be calculated... but in 3d, an object can be any length wide or long... so how do i calculate that?

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Sep 2009 11:28
Actually I don't really get what you're trying to do.

Do you want to edit a 3D object with the mouse by dragging vertexes around?
And the rotation? Do you want to rotate the object around the point on the object you clicked with the mouse on?

Nothing happening after compiling your code can have multiple reasons. The ones coming to mind are not properly locking and unlocking the vertex data of your mesh/limb. Also your pseudo-code seems a little dodgy to me. Other reasons can be messed up variable names, a wrong calculation, etc.

Sven B

Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 13th Sep 2009 09:29
Take a plane and drag two points (left and right 2) and calculate the angle of left and right 1 based on left and right 2's position and mirror the angle of the rotation for left and right 2 as to create a 3d line. The point is to create a dragable object.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Sep 2009 21:29
I have no clue what you're saying, sorry.
Perhaps someone whose mother tongue is English could take over?

If you just want a 3D object you can drag around, you should search the forums...

Sven B

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 14th Sep 2009 06:14
Quote: "Take a plane and drag two points (left and right 2) and calculate the angle of left and right 1 based on left and right 2's position and mirror the angle of the rotation for left and right 2 as to create a 3d line."


Okay... so you want to click on a 3d object, and drag it to another place in 3d space?

The way you're explaining it doesn't really make sense. Contradicting angles? mirroring the angle of rotation?

Also, this is just a slight correction but even in 3d space, it's still a 1 dimensional line. A 2 dimensional line would be a plane. To be two dimensional, it needs width and height, a line just has length.

AAaaanyways, i think that this algorithm (thats untested and just popped into my head) will work fine.

1. Get the mouse x and y coordinates
2. on mouse click, use "Pick Object" to find the object the user is clicking on.
3. While the user holds the mouse, use pick screen at the x and y position of the mouse, and a depth that is the distance the camera is from the object (the unmoved object).
4. When the user lets go of the mouse, the last result from "Pick screen" will be the new and final position of the object
5. ???
6. profit.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 17th Sep 2009 10:52
@Neuro Fuzzy

We're on the same page. the angle I am talking about is where the two vertexes are positioned in comparison to the ones being dragged by the mouse... how do i grab this angle... since a plane is potentially 2d (or 3d if we were to consider a flat box a plain) then the angle would need to be calculated from first click (point a) to mouse release (point b) if you were to imagine each end with its on pivot point based on the direction of the opposing side, one could then say that the angle could be determined by the length in which it's drawn in total and based on point a and b. But correctly determining diagonal and free form angles is baffling to me... hell the entire way to calculate and position vertexes escapes my feeble mind from fathoming!

so again... point a to point b... angle of the dragging vertexes in comparison to the stationary vertexes... rotation of stationary vertexes in comparison to dragging vertexes - no they aren't independent of one another.

I hope that helps

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 9th Oct 2009 10:55
I'm sorry, but I don't want so much code as I want an understanding of what it may or may not do... so could some one just like make a dragable road and see the difficulty in drawing it!

love you all

*bump*

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 24th Oct 2009 11:01
Alright screw it. Lets say I have an object I've designed, say a road. How would I using limbs - as I've not used them in this manner - draw a line in an octagonal nature . (N, NE, E, SE, S, SW, W, NW) If you can just give me an understanding of how to link an object together as if it were like pixels in a line. I have tried several things but I've gotten no answers (needed) to help me understand the vertexdata idea I had. Any one HELP!

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 25th Oct 2009 06:04
so now are you saying that you want to draw an octagon of 3d objects on the same plane as some 3d object? Do you want to draw 3d lines? Do you want to drag a 3d object? I'm just not clear what the question is...
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 27th Oct 2009 01:31
LOL i think I'll let this thread die. I have confused too many people in too many ways. I want to draw an object like a line restricting it to drawing in this format "straight up, down, left right, diagonal right, left up and down." I need to calculate angles based on the first click where the object is being drawn from (point a) based on the position off the moving mouse(point b) and then finalize point b's position when the mouse is released. - make sense. Just try drawing a 3d plane this way. Calculating the angle of point a from the position of point b is rough and tough to do

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Login to post a reply

Server time is: 2024-09-28 12:23:17
Your offset time is: 2024-09-28 12:23:17