Jump to content

custom uv position and double side material.


amo yeh
 Share

Recommended Posts

Try to generate a custom mesh with material. this is what I did so far ~ 

http://www.babylonjs-playground.com/#1WGFZV#2

 

Appreciate if anyone could answer or correct my issue

1. How to create a double sided face ? tried backFaceCulling but don't seem to work.

2. I would like the triangle to display custom uv position, a image explain what I am trying to accomplish.

 

I search on the forum and found out a similar problem here , but still uncertain the correct way to do it.

thanks for the help ~ 

 

update : I think I posted this on the wrong section , should be under Question and answers , please help to modify , thanks

Link to comment
Share on other sites

Hello (I moved the post)

 

1. I tried with backFaceCulling = false and then I can see the back face:

http://www.babylonjs-playground.com/#1WGFZV#3

But I guess you want different UV for the back face? In this case you have to duplicate geometry

2. For this you will need 6 vertices instead of 4 as the corner vertices do not share UV

Link to comment
Share on other sites

 

I tried to use 6 points instead of 4 to create 2 triangles with different scaled uv as mentioned from the image.

http://www.babylonjs-playground.com/#1WGFZV#9

It seems to work as expected, a square with two custom uv locations.

according to other post replied 

 

@RaananW said

 

Quote

"The babylon format works differently. It is rather redundant, but wonderful for performance. If you want to add a new uv to an existing position definition, you will have to duplicate this position and add the uvs definition at the correct position. This is due to the indices definition. Not like obj, indices is only 1 number, meaning 1 position of the array. You can't reference a specific uv definition and a different positions definition. "

 

 

so I suppose this is the correct way to do it ?

Thanks for the help~

 

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...