coded improved UV sphere/tube mapping

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

bjornmose
Posts: 158
Joined: Tue Nov 25, 2003 5:27 pm
Location: Denzenberg, could walk to Hölderling-Tower
Contact:

coded improved UV sphere/tube mapping

Postby bjornmose » Tue Dec 09, 2003 10:27 am

young persons quide to coding blender :
If you do not have CVS write access, the best way to submit a patch to Blender is first to give your patch to someone else and have them test it.


To warm up with the blender code i tweaked the function uv_autocalc_tface() in src/editface.c .
1. in cylinder/shere mapping the "zero angle" was always pointing backward (such that a head looking out of the screen in front view was mapped to have the neck in the center of the UV map) added popup to choose direction.

2. the projection center allways was calculated as the center of the bounding box of the selected vertices (which gives very funny results if you select the "face" part of a head ) experimented with the "around" selecet of the 3d view and a popup to select center ( see comments in the source )

so here is what i did
http://mitglied.lycos.de/mosebjorn/tuhopuu/

the original file was a tuhopuu checkout sun 12/07/2003

so maybe "someone else" may want to test it, and if its OK ask the keepers of the holy code to merge it to the project.

BM
Last edited by bjornmose on Mon Dec 15, 2003 4:04 pm, edited 1 time in total.

sherman
Posts: 9
Joined: Tue Nov 25, 2003 4:36 pm
Location: Malaysia
Contact:

Postby sherman » Wed Dec 10, 2003 4:38 pm

Sorry for this slightly unrelated question but is there something
wrong with UV Mapping from Window in Blender 2.31a? I UV mapped
the Monkey face using the "From Window" option but the vertices
were messed up. However, the other mapping options worked fine.
Same goes for the other meshes - their "From Window" option didn't
turn out well. It is quite important for me to use "From Window" UV
mapping because I do lowpoly modeling for games and that is the
fastest way for me to UV map. Thanks.
_________________
Best regards,
Sherman Chin
Sherman3D Sdn Bhd
www.Sherman3D.com

bjornmose
Posts: 158
Joined: Tue Nov 25, 2003 5:27 pm
Location: Denzenberg, could walk to Hölderling-Tower
Contact:

Postby bjornmose » Wed Dec 10, 2003 5:01 pm

sherman, in 2.31a there is a know bug in UV mapping
in the current CVS version this was fixed

to all others:
did anyone look at it ? or what am i doing wrong ?

BM

sherman
Posts: 9
Joined: Tue Nov 25, 2003 4:36 pm
Location: Malaysia
Contact:

Postby sherman » Thu Dec 11, 2003 8:15 pm

Thanks for the reply, bjornmose.
I guess I will just wait for the next version - hopefully
the one coming with the printed manual will have
UV mapping fixed so I don't have to download it again.
In the meantime, I will just go on re-learning all the
other Blender features. Thanks again. ^_^
_________________

Best regards,

Sherman Chin

Sherman3D Sdn Bhd

www.Sherman3D.com

TorQ
Posts: 112
Joined: Wed Jan 29, 2003 2:03 am

Postby TorQ » Sat Dec 13, 2003 1:47 am

Might I suggest!! heh heh heh. :) I have a few suggestions that I think might take what you are doing to the next level. I feel that a good cylinder mapping is one of the most efficient ways to map a model. Here are the additions to what you are doing that I propose. As you pointed out Blender sets the center of the unwrap cylinder to the center of the selected verts and only in a vertical orientation. This fact makes the cylinder mapping tool extrememly limited because the user ends up having to rotate the model to accomodate the cylinder. Blender has extremely agile viewport manipulation, this can be used to our benefit by projecting the unwrap cylinder top down from the current view. This would allow one to quickly allign the unwrap tool to the model rather than the other way around! Secondly the "split point" for the mapping would be located at a fixed point in the view so that the user can also define the point at which the mapping is split. Lastly the radius of the cylinder can be set visually in the view by scrolling the mouse wheel or pressing the plu or minus keys on the numerical keyboard. I have included a mockup of this idea that hopefully will clarify what I am talking about. Please let me know what you think or if I need to be more clear. Thanks for your time!


TorQ

Image

sherman
Posts: 9
Joined: Tue Nov 25, 2003 4:36 pm
Location: Malaysia
Contact:

Postby sherman » Sat Dec 13, 2003 7:35 pm

TorQ,

Thanks a lot for your post. ^_^ Sorry for not replying earlier but
the "notify me when a reply is posted" feature doesn't seem to
be working for me. 0_o;

I haven't tried your technique out yet but won't cylindrical mapping
mean that we can't make full use of our texture image file? There
would be overlapping flatten cylinders but we need all the optimization
we can get in a game (including making our texture files as small
as possible and keeping all textures in one image file).

Thanks for your suggestion though. ^_^
_________________

Best regards,

Sherman Chin

Sherman3D Sdn Bhd

www.Sherman3D.com

TorQ
Posts: 112
Joined: Wed Jan 29, 2003 2:03 am

Postby TorQ » Sun Dec 14, 2003 4:33 am

OOooppsss!


Sorry, Sherman my last post was directed at bjornmose! I was suggesting some changes he could make to the UV mapping code since he was working on that. Still, Cylinder mapping is a great way to quickly map a game character too. That is what I use a lot at work.

TorQ

sherman
Posts: 9
Joined: Tue Nov 25, 2003 4:36 pm
Location: Malaysia
Contact:

Postby sherman » Sun Dec 14, 2003 7:00 am

No problem, Torq. ^_^;;; Cylinder mapping is a great way to prototype
a game model but we still have to stick to face UV mapping to optimize
our texture image files. I guess I will patiently wait for the next stable
release of Blender. ^_^
_________________

Best regards,

Sherman Chin

Sherman3D Sdn Bhd

www.Sherman3D.com

bjornmose
Posts: 158
Joined: Tue Nov 25, 2003 5:27 pm
Location: Denzenberg, could walk to Hölderling-Tower
Contact:

Postby bjornmose » Mon Dec 15, 2003 10:35 am

Hi TorQ

thanks for taking the time !

1. i agree with the proposal for setting the projection center/split point. i alreay spotted the line in code where it has to be done (and how ) but this is some more work not unsolvable though.

2. "classical" cylinder mapping maps to the "unit" cylinder. however what you want to have is a unwrapping along arclenth ( then the radius makes sense).
well i am thinking about it and i see a chance to do it.

may be i did not point out clear enough?
besides of discussing, my post was intended to let check other developers code i ALREADY DID!
so the link (http://mitglied.lycos.de/mosebjorn/tuhopuu/) points to the altered source file where the above features are available and possible changes for extensions are marked with comments too.

Well, it seems to be the wrong way to contribute development work.

But how to do i right then ?

BM

matt_e
Posts: 898
Joined: Mon Oct 14, 2002 4:32 am
Location: Sydney, Australia
Contact:

Postby matt_e » Mon Dec 15, 2003 10:44 am

Hi, It's probably best to sign up to the tuhopuu-devel mailing list, and post the patch there. it seems that the clever developers that would be able to understand this patch don't read the forums all that often :)

cheers

bjornmose
Posts: 158
Joined: Tue Nov 25, 2003 5:27 pm
Location: Denzenberg, could walk to Hölderling-Tower
Contact:

Postby bjornmose » Mon Dec 15, 2003 11:53 am

hi broken

so why does this
http://www.blender.org/modules/documentation/intro_source.html

say
If you do not have CVS write access, the best way to submit a patch to Blender is first to give your patch to someone else and have them test it. Once thats done, subscribe to the bf-committers mailing list and email your patch to bf-committers@blender.org.

?????
and i wanted to do one after the other

BM

matt_e
Posts: 898
Joined: Mon Oct 14, 2002 4:32 am
Location: Sydney, Australia
Contact:

Postby matt_e » Mon Dec 15, 2003 11:59 am

Well, from the looks of it, nobody has come across this topic here and tested it, so try step 2 and see if you can get some attention there :) Like I said, not all the developers read these forums regularly.

bjornmose
Posts: 158
Joined: Tue Nov 25, 2003 5:27 pm
Location: Denzenberg, could walk to Hölderling-Tower
Contact:

Postby bjornmose » Mon Dec 15, 2003 1:05 pm

what are rules for noone obeys?

grumble, grumble .....

BM


Return to “Interface & Tools”

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests