• Advertisement
Sign in to follow this  

Textures

This topic is 1823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Yes, they are duplicated.
For example, 2 related quads have 2 common vertices, so, each of those vertices will be added in buffer 2 times, for each of quad.
Each quad has 4 vertices, even if it located inside the surface and surrounded with other quads. It is not very well, I know, becouse many points are duplicated up for 4 times. I'll try to fix it later (skip duplicating points), but right now my primary objective is to make such kind of color transition.
But is it important? Point will be added several times (for each rectangle) but with same texCoords...

Share this post


Link to post
Share on other sites
But is it important? Point will be added several times (for each rectangle) but with same texCoords...
It may be. When you iterate over all the points (for (int j = 0; j < list.Count; j++)), including the duplicates, they may no longer match up with what you have stored in 'elements[i].valueOnPoint[]' when you index it with 'j'. Edited by eppo

Share this post


Link to post
Share on other sites


But is it important? Point will be added several times (for each rectangle) but with same texCoords...

It may be. When you iterate over all the points (for (int j = 0; j < list.Count; j++)), including the duplicates, they may no longer match up with what you have stored in 'elements[i].valueOnPoint[]' when you index it with 'j'.

No, they matches well, becouse "list" is an "element[i]".
Sorry if I confused you.. Element class is representing quad (points and data) and Node class is representing point (coordinates).

for (int i = 0; i < elements.Length; i++)            
{                
List list = elements[i].Nodes;                
for (int j = 0; j < list.Count; j++)                
{                    
points.Add(new Vertex()                    
{                        
Coord = new Vector2(chooser.GetTexture1DCoordinate(elements[i].valueOnPoint[j]), 0),                        Position = new Vector3(list[j].X, list[j].Y, list[j].Z),                    
});                
}
}

Share this post


Link to post
Share on other sites
You were damn right!! The problem was in TexCoords! 

Thank you EPPO,

Thank you all for helping!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement