Directx Modeller

Started by
1 comment, last by saravanan_nanothink 14 years, 5 months ago
Hi Everybody, I am new to this forum, i am from India, i am currently developing a modeler application in directx, so, how can we implement vertex and edge picking thru mouse as like object and face picking. Thank you, Any code samples are greatly appreciated. If i implemented it successfully, then i will post my code publicly.
Advertisement
You can vertex pick by just a single poll of the verts, project then compare with mouse position or a select box.
That gets heavy once there is too many verts, but it should work up to about two hundred thousand points.
If your dealing with a model thats heavier pointwise than that (like your making zbrush) probably a point list render of the points and gather the ids under the mouse by reading off the texture.

Edges could be selected just like verts, except you project the edge 2 verts at a time and use a line point proximity test against the mouse - and you actually do the work in 2d.

Theres lots of ways of going about what you said, just figure something out that works with the software and hardware your using, fastest method being the best... but even ease of implementation is important too.

Back face culling is important too, just make points that dont have a face pointing towards the camera unclickable.
An even better method than that is to use a zbuffer, and thatll make sure you cant click on hidden verts.

Calculating triangle adjacency is important, you should work out how to do that because alot of the time youll be using it.

Hope this helps a little.
Thank you rouncED.

This topic is closed to new replies.

Advertisement