Jump to content

CreatePolygon texture warp


Asor
 Share

Recommended Posts

I am trying to make a prism generator using BABYLON.CreatePolyhedron. Everything seemed ok until I applied a texture to it.
http://www.babylonjs-playground.com/#AVCC8#6

Babylon is splitting the mesh into triangles like you would expect, but then it is failing to map the new UV points in a sane way. I was able to manually set the new UV values to make it work, and can just automate the process, but It is a bit of a hack. Is there an easier fix to this?

Thanks in advance for any help

Link to comment
Share on other sites

short answer : I'm afraid no for now

How to set the UV on a surface is always a choice.

The provided polyhedrons are built from sets of pre-computed data and we haven't any pre-computed (of any choice) UVs. So the less worst solution we found was to set the UV by applying a rotation from the first vertex of a polyhedron face onto the texture image and to give from this rotation start the next vertices 2D coordinates as UV (not sure I'm very clear : in short, we choose a computionnal way working in every case).

This can lead to some results you woudn't have to get. They aren't false, they're different from what you expected.

So, manually setting the UV to your expectation still remains the best way to get what you want.

Maybe might I add a parameter in the polyhedron constructor method to give the ability to the user to pass his own UV set ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...