• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Design & Development v
« Previous 1 … 6 7 8 9 10 11 Next »
Want to finalize a new wings_we:build for colors.

 
  • 0 Vote(s) - 0 Average
Want to finalize a new wings_we:build for colors.

ggaliens
Offline

Erlang Hacker
Posts: 954
Threads: 143
Joined: Nov 2012
#3
10-22-2014, 11:25 PM (This post was last modified: 10-22-2014, 11:31 PM by ggaliens.)
Micheus. You have some good ideas and observations. I will use array:fold

Anyways ... your code is not finding Color . That is one the the problems. I'm using a GbTree now
to do it faster instead of lists:nth. lists nth is just tad slow.

Little bit better ... maybe. I should maybe check that Vs and Vc are of equal length !
I was able to get the PLY vertex colors to work very easily because standard import codes
are doing a bunch of work ... so I want to fix it in a general way ... you know ... and do a pull request if I can get it done just right. Then I can also update WRL importer (old I know).

Code:
build(Mode, #e3d_mesh{fs=Fs0,vs=Vs,tx=Tx,he=He,vc=[{_R,_G,_B}|_]=Vc}) when is_atom(Mode) ->
    Fs = translate_faces(Fs0, list_to_tuple(Tx), []),
    #we{vp=VPos} = We = wings_we_build:we(Fs, Vs, He),
    Dict = lists:zip(lists:seq(0,length(Vc)-1), Vc),
    Tree = gb_trees:from_orddict(Dict),
    MyAcc = fun(Vi,_VAL, Acc) ->
         wings_va:set_vertex_color(gb_sets:singleton(Vi),gb_trees:get(Vi,Tree), Acc)
    end,
    We1 = array:fold(MyAcc, We, VPos),
    wings_we:renumber(We1,0);
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
Want to finalize a new wings_we:build for colors. - by ggaliens - 10-22-2014, 05:29 PM
RE: Want to finalize a new wings_we:build for colors. - by micheus - 10-22-2014, 08:53 PM
RE: Want to finalize a new wings_we:build for colors. - by ggaliens - 10-22-2014, 11:25 PM
RE: Want to finalize a new wings_we:build for colors. - by micheus - 10-22-2014, 11:43 PM
RE: Want to finalize a new wings_we:build for colors. - by micheus - 10-25-2014, 07:24 AM
RE: Want to finalize a new wings_we:build for colors. - by ggaliens - 10-26-2014, 12:27 AM
RE: Want to finalize a new wings_we:build for colors. - by ggaliens - 10-27-2014, 02:29 PM
RE: Want to finalize a new wings_we:build for colors. - by micheus - 10-27-2014, 04:08 PM
RE: Want to finalize a new wings_we:build for colors. - by ggaliens - 10-27-2014, 05:59 PM
RE: Want to finalize a new wings_we:build for colors. - by micheus - 10-27-2014, 11:22 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode