Set Material stuff

That’s correct about UV coordinates-whether it is 0 to -1 or 0 to 1 depends on the mapping flags though. I can’t remember off hand which it is. This (1 or -1) is required to ensure the texture isn’t upside/flipped.

It is an unfortunate andquot;featureandquot; of the development environment that I use that requires the extra points. hopefully that will be resolved in an upcoming release.

Richard

Howdy

Say I have an object and want to paint faces individually with the paint brush. andnbsp;My material is a bitmap texture tiled to fit the face.

Then in a script I take the material and set it to M.

Then I create a new object with faces, each of which are treated to

Face.SetMaterial(M).

The results isn’t the same as painting the faces. andnbsp;Looks like it is stretched a long way.

Does this brief description allow anyone to help me?

George

Have you set the texture coordinates for the points?

Richard

Richard

No I hadn’t set texture coordinates. I tried it and had no luck.

But after two days with 50 kindergarten kids
debugging code is quite calming. andnbsp;Perhaps you could confirm my discoveries before I go on coding.

I couldn’t find much on your uv scheme, nor that of povray, so wrote a little script to analyse it. andnbsp;Is the scheme uv = 0,0 at bottom right and -1,-1 at top left (for a bitmap mapped to a square face)?

The main discovery is this:
when you paint an individual face on an object, you always have to create enough points to hold the texture information? andnbsp;What I hadn’t realised was that
you create extra points with the same spatial coordinates just to hold the texture coordinates.

So my script was to add textures to the terrain created by the terrain builder. andnbsp;I had intended to paint them all individually based on altitude, gradient, sunshine
or whatever. andnbsp;So for each triangle I will have to create two extra points.

I wonder if there are more efficient ways to do this as the scheme is repetitive.

George

OK. I solved it by going through the whole object face by face, copying the points to a new object and assigning uv textures there.

So for a terrain of 8000 faces I’ve now got ]24000points <!– s:-) –><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile" /><!– s:-) –> andnbsp;

But I’ve learnt a lot and now have much better control over the results.

George

You must be logged in to reply in this thread.

5 posts
recent posts