Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Share Thread:
Reddit Facebook Twitter
Geodesic Distance mesh coloring (seeking)
04-28-2016, 04:16 PM (This post was last modified: 04-28-2016 04:19 PM by ggaliens.)
Post: #5
RE: Geodesic Distance mesh coloring (seeking)
Cycling colors would just mean repeating the rainbow more times over a given surface distance. More banding.

In my mind ... this probably means increasing the resolution of the underlaying mesh so that we have more discrete places to put rainbow bands. If were are both nativeEenglish speakers ... we need to stick to words and metaphors like RAINBOW and repeat. But is you really like code ... I can just send you the code snippet ... since it is very short.

Code:
command({vertex,{manifoldlab,topo_bullseye}}, #st{sel=[{WeID,_}]}=St) ->
    Qs =
      [ {label, "Topological Units to run ... "},
        {text, 36,   [{width,10},{key,units},{range,{0, 720}}]},
        separator,
        {label, "Every 18 units is a rainbow cycle"}
      ],

    wings_dialog:dialog("Rainbow Please ... ", Qs,
        fun(Res) ->
            {units,Units}  = lists:keyfind(units, 1, Res ),
            #we{} = We = gb_trees:get(WeID, St#st.shapes),
            MyAcc = fun(Idx,#st{sel=[{WeID,AccSet}]}=AccSt) ->
                Idx2 = Idx rem 18,
                #st{sel=[{WeID,SetMore}]} = wings_sel_conv:more(AccSt),
                SetNow = gb_sets:subtract(SetMore,AccSet),
                H = Idx2 * 20.0,
                S = 0.999,      %% we are just throwing down rainbow colors ...
                V = 0.999,
                RGB = wings_color:hsv_to_rgb({H,S,V}),
                AccSt2 = wings_vertex_cmd:set_color(RGB,AccSt#st{sel=[{WeID,SetNow}]}),
                AccSt2#st{sel=[{WeID,SetMore}]}
            end,
            case Units of
                    0 -> Polycount = length(array:sparse_to_orddict(We#we.vp)),
                         Count = round(math:sqrt(Polycount*1.0));
                    _ -> Count = Units
            end,
            lists:foldl(MyAcc, St, lists:seq(0,Count))
        end);
Reply


Messages In This Thread
RE: Geodesic Distance mesh coloring (seeking) - ggaliens - 04-28-2016 04:16 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)