Problem with positioning Vertices with Mouse.

Blitz3D Forums/Blitz3D Programming/Problem with positioning Vertices with Mouse.

Guy Fawkes(Posted 2012) [#1]
Hi, all. I'm currently working on a mesh editor, and need help with 2 things. I would like to be able to position the vertex using the mouse, and would like to know how i can make all vertices 'lock' to the object, so that way, instead of moving a vertex and only having it move ONE face, it moves ALL faces connected TO that one vertex point.

Here's the code:



For easy access, the part of the code that i need help with, is located here:



Any help is greatly appreciated!

Thank You! :)

Last edited 2012


Yasha(Posted 2012) [#2]
The second question is irrelevant. When you move a vertex, all faces connected to the point will move. If you're not seeing this happen, it means that you actually have more than one vertex in exactly the same place, and the triangles in question aren't really sharing vertices.

What you likely have is an "unwelded" mesh, and what you want is a "welded" mesh. Look in the archives for about a hundred variations on mesh welding functions.

There are a lot of good reasons why a model will usually be unwelded - the most notable is that a vertex can only be lit/textured one way, so you can't share vertices if you want nice sharp edges on your hard corners, and the bordering triangles have to share at least one texture point, which may not be artistically practical. Note that for this reason you should not attempt to weld or unweld artistically complicated meshes, as it will completely obliterate the UV map and normals and stuff. Once two vertices have been reduced down to one, all data for the second one (except obviously position) will be lost forever!

If you really want to drag verts around, use an editor (like Wings3D). Replicating that kind of vertex-dragging in Blitz is very difficult, as Blitz uses raw DX surfaces following the rules outlined above; Wings has a much, much more flexible base mesh structure that actually allows you to do what you're talking about here (it also has features like non-triangular polygons and stuff).

If you want to make an editor like Wings in B3D, my advice is that you probably shouldn't. There are better tools, and the old adage of "if you have to ask, you don't know what you're doing" applies in force.

Last edited 2012


Guy Fawkes(Posted 2012) [#3]
I just need something that is free, where I can drag selected vertices at will. I dont care what it is.


Adam Novagen(Posted 2012) [#4]
Wings3D.


Yasha(Posted 2012) [#5]
Then use Wings3D directly.


Guy Fawkes(Posted 2012) [#6]
OMG! THANKS GUYS! THIS IS EXACTLY WHAT I INTENDED TO MAKE IN BLITZ! BUT FORGET THAT! =D