Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / MATLAB / October 2008



Tip: Looking for answers? Try searching our database.

Interesting Triangular 3D Mesh texturing situation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
loxics - 03 Oct 2008 19:06 GMT
Hello again,

My today's question is in regards to texturing a triangular 3D mesh. Picture will be worth a thousand words so here is the image of my predicument:

http://dl.getdropbox.com/u/47489/triangular_mesh_texture.jpg

I am using a 'patch' function since 'surface' does not work with 3D triangular meshes. Unfortunatly, if you can see from the model, the 'X' texture (shown on far right) will only map to the model at its vertices, giving us the spotty look and discontinuity in the line (hence, low quality texture imagine).

Is this the simple nature of how 'patch' function works? I have spent days trying to find a way to texture map to the actual surface instead of just vertices but I have had no luck.

Do you have any suggest on how I may texture map onto this triangular 3D model and maintain quality of the texture image?

Thank you.
Kenneth Eaton - 03 Oct 2008 23:31 GMT
loxics <loxics@gmail.com> wrote in message
> Do you have any suggest on how I may texture map onto this triangular 3D model and maintain quality of the texture image?

What you were doing isn't exactly "texture mapping", since patch objects don't support that. I'm guessing you were setting the CData property of the patch object. You should check the MATLAB documentation regarding this patch property. It indicates how you can add one color per triangular face (i.e. each face has a flat color, I believe) or one color per vertex, which I think is what you were doing which gave you the image you had linked to. This isn't exactly like texture mapping, where you can map multiple colored pixels to a face, but it's the best you can do with patches as far as I know.

Hope this helps,
Ken
loxics - 06 Oct 2008 14:34 GMT
I see, thanks for the information.

Besides patch then, is there any other feature in MATLAB that is remotely close to Texture Mapping?
Kenneth Eaton - 07 Oct 2008 17:42 GMT
> I see, thanks for the information.
>
> Besides patch then, is there any other feature in MATLAB that is remotely close to Texture Mapping?

Only surface objects support texture mapping, but plotting surfaces generally requires regular grids. Since you have an irregular triangular grid, this makes things difficult. The question becomes how attached are you to showing the triangular grid in the image, or are you willing to transform it to a regular grid for the sake of displaying a texture-mapped image?

If you really want a texture-mapped surface, I would check out the following MATLAB documentation:

http://www.mathworks.com/access/helpdesk/help/techdoc/visualize/f0-45715.html

(The address might be wrapped funny) If you scroll down to where it says "Surface Plots of Nonuniformly Sampled Data", you can see how you may be able to generate a regular surface from your triangular one. Using this regular grid, you should be able to create a surface that you can texture map to.

Hope this helps,
Ken
loxics - 08 Oct 2008 16:07 GMT
Thank you very much for all your help, i will have this a look.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.