Wings 3D Development Forum
Vector Groups - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7)
+--- Thread: Vector Groups (/showthread.php?tid=1117)

Pages: 1 2


Vector Groups - Namrata - 03-25-2015

Hi,

I am new to wings3d development, and I need help getting started with the plug-in I am trying to develop.

I was wondering if there is any way of defining vector groups in wings as we do in blender. If not what is the best way to replicate something similar??


RE: Vector Groups - ggaliens - 03-25-2015

First you should define what you vector group is (for us ... your audience) and tell us how you plan to use them. Then we might be able to better assist with ideas.

There is some prior art in Wings3D world that would call a collection of adjacent faces ... a "region". I wonder if this is close to what you speak of.


RE: Vector Groups - Namrata - 03-25-2015

The Vertex Groups could be used to tag vertices as belonging to a certain part of the mesh, think of the legs or seat of a chair, the whole chair, the hinges of a door, etc.
So basically I want to define groups of some vertices that have the same properties.


RE: Vector Groups - ggaliens - 03-26-2015

There are many ways to get this done.

You can use wings plugin state. You could use vertex colors if your didn't think those already occupied.

You could use gb_sets if the values are somewhat transient/volatile in memory.

And I think there is an offical way to do it with vertex attribute lookup. I think see how colors and uvs are stored per vertex and do the same for your properties and SAVE/LOAD might be free of charge.


RE: Vector Groups - Namrata - 03-26-2015

Thanks, that seems to be something I can use. However when reading the source code i came across the function wings_vertex:fold(...).

Could someone please explain what exactly this function does.


RE: Vector Groups - micheus - 03-26-2015

(03-26-2015, 08:36 PM)Namrata Wrote: However when reading the source code i came across the function wings_vertex:fold(...).

Could someone please explain what exactly this function does.
In a very short answer: "Fold over all edges/faces surrounding a vertex."

There is some minimal comments in the source code. Just look inside of wings_vertex.erl


RE: Vector Groups - Namrata - 03-26-2015

I looked over the code, but being new to modelling and wings, I am unable to understand what exactly does 'Fold over all edges/faces surrounding a vertex' mean.


RE: Vector Groups - micheus - 03-26-2015

I'm sure ggaliens will be able to help you more than me. Smile

By now, maybe you would like to know that Wings3D uses the The Winged-Edge Data Structure - the data structure used to store the adjacency relationships between edges, faces, and vertices in a Wings 3D model.


RE: Vector Groups - ggaliens - 03-27-2015

fold is generally meaning "iterate over". There are no true loops in Erlang. Most all of that is done either via recursion or accessor functions (which probably are implemented recursively).

Look at lists:fold( ) and try that first. wings_vertex:fold will behave like that.

If you are very serious about learning Erlang/Wings3D programming ... I would be willing to do a few Q.A. study up sessions with you to help get you going. But there is no replacement for some talent plus the drive to dive in head first. Good luck.

Another way of putting it ... wings_vertex:fold and some of the other fold function help to keep you at arms length and protect you from the details of W.E.D.S. that Micheus points to ... nevertheless ... that sort of background WEDS information is good for you.


RE: Vector Groups - Namrata - 03-27-2015

Ok, I shall look it up.

And if possible I would like to take you up on the offer of the study session. I would really like to get to learn Erlang/Wings3D programming and I seem very lost as of now.