Archived

This topic is now archived and is closed to further replies.

Bugs in TexCoords in a tunnel!!!!!!

This topic is 5968 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

Hi!! I just wondered if someone could be kind enough to help me find out what i have done wrong here...(see screenshot below)!! !! If any of you wants to take a look at the source...send me a mail and i''ll bring it over as soon as possible!! !! Hope anyone can help me out here!! Thnx!! Take Care! - -- ---[XaOs]--- -- -

Share this post


Link to post
Share on other sites
There are two possibilites:

a) Your texture is bad. (It isn''t tilable)

b) The vertices along the seam don''t have the same colors if your not using lighting, or if your using lighting then they don''t have the same normals.

I suspect that (b) is the problem in this case. Your doing gourad shading here, and probably averaging the verex normal by using the adjacent triangles. But the vertices along the seam your not taking into acount some of the polygons.

If you imported the model from a modeling program and are using the normals you got from it, then try the equivelent of welding the vertices among the seam in your modeling program before you export. If you generating the geometry through an algorithm in your code, then make sure you calculating the normals correctly as I described in the previous paragraph.

Share this post


Link to post
Share on other sites
Now that i look at it again, it might be the texture. Can you post a wireframe image, and an image without any lighting(just do glDisable(GL_LIGHTING); and glColor3f(1.0, 1.0, 1.0); for all the vertices.

Share this post


Link to post
Share on other sites
Hi!! Sorry to dissapoint you....but there is no object here....nor any lighting!! What you see on this picture is a simple grid (array containing points) witch is bend around to form a tunnel!! Then i lay the texture on and manipulate it so it looks like in the picture!! Those things looking like an object (i presume those where the one you where talking about) are just a little effect i bumped into when i was plaing a little with the math involved here!!

If you wan't me to send you the source i can do that...so that you can take a look for yourself!!
(Just reply here or send me a mail before tomorrow afternoon)!!

Take Care!


and btw : The texture is a tile....look around in the tunnel...it is tiled everywhere else but the "bad point"!!


- -- ---[XaOs]--- -- -


Edited by - XaOS on August 13, 2001 1:21:21 PM

Share this post


Link to post
Share on other sites
Could you post up what just one tile of the texture is supposed to look like (a.k.a. the picture the texture is coming from)? That''d probably help in trying to figure out what''s going wrong...

~ Dragonus

Share this post


Link to post
Share on other sites
You got all of that tunnel on just that one little tile there!? Wow, I''m impressed. ^_~ I was expecting something bigger, hence why I asked for it.

However, here''s a shot in the dark... (Correct me if I''m making the wrong assumption here.)

I asked for the tile so I could see how it fits into the tunnel. The way it appears is that the vertical section (of the 2D tile) runs inwards/outwards in your tunnel, while the horizontal section of the tile goes around the tunnel, supposedly making a circle. I hope I''m correct in thinking this.

Inwards/outwards appears to be no problem. It''s the "round the loop" that you''re having trouble with. For it to be tileable horizontally (or "round the loop"), you have to have an even number of tiles going around. (a.k.a., a whole tile + 1/2 of a tile won''t cut it if you travel around the loop).

Provided I''m on target, your tile has two bright bands. Now looking at your tunnel pic, starting at 3 o''clock (the right) and going clockwise, the 2nd bright band is at 9 o''clock, and thus the first tile going around ends somewhere around 12 o''clock-ish. As you continue to travel around, we hit a THIRD bright band, which indicates that there''s another tile present when going around, which causes your problem area.

The idea is that you have to use the entire texture an integral number of times throughout the 360 degrees of the tunnel. If you don''t, bad things like what you''re showing happen.

Am I anywhere close on this one?

~ Dragonus

Share this post


Link to post
Share on other sites
Hi!!

You found out whats wrong!! !!!
I have tried to something almost like what you said...(for checking ofcourse)....but i turned just as clueless as i still am!! Are you sure i''m not gonna send you the source?

At least this way you could take a look at it and really see how
i do it!! (It involves some math though...but it shouldn''t be a problem)!!

Let me know what you think.....

Thanks for really trying to help me here!!

Take Care!


- -- ---[XaOs]--- -- -

Share this post


Link to post
Share on other sites
quote:
Original post by XaOs
Are you sure i''m not gonna send you the source?

At least this way you could take a look at it and really see how
i do it!! (It involves some math though...but it shouldn''t be a problem)!!


Send it on over. ^_^ I''ll take a look-see at it as soon as I can.

~ Dragonus :D

Share this post


Link to post
Share on other sites
Found the problem. Haven't found the solution...

The problem is in this line of code in your draw routine:

  
texcord[i][j].u = j / 3 + cos(((Angle) + 8 * i) / 60) / 2;


Specifically, it's that 8 up there that's the problem. I've replaced the 8 with a 1 and it works great, but it changes the effect, something I'm not sure you want done.

Really, I can't understand much of the equation at all. I understand that "j" deals with depth, and so j/3 is going to be constant. That's fine. Essentially you through that out.

Going around the circle deals with "i", and I'm lost within this part...

cos(angle + 8i/60) / 2

What's your rationale for that part?

~ Dragonus

Edited by - Dragonus on August 14, 2001 3:03:05 PM

Share this post


Link to post
Share on other sites
Hi!!

Great work......

I have to tell you that i actually don''t get that line 100% myself!! You see....this little tunnel effect is based on a plasma tunnel that Jan Horn (Delphi programmer) made, and i am partly using some of his math stuff, cause i spent over 3 days trying to write one on my own that should do the same....but it didn''t work out really good! Ans as you can see, i can''t make it work really well with some of his math either!!

How ironic is that.....

I am going to see what happens if i doo what you said...but i think i know because the line looked awfully familiar....and i do think i have tried that before!!

Well.....anyways i wanna thank you for trying so hard!!

Keep it up...this forum needs people like you! !!

Take Care!!

- -- ---[XaOs]--- -- -

Share this post


Link to post
Share on other sites
THOSE WHO DO NOT GIVE UP, SHALL BE REWARDED!!!!!!


I was sitting in my chair...looking madly at the code...and i though.....what will happen if i remove that stupid I...?
So i removed it and bravely pushed F5.....and you know what?

It was the I.....it was one stupid little char who made that ugly line!!!!

I finaly made it..after 3 days of not understanding anything......can you understand how that feels?

(Now i sound like i have saved the world from destruction or something...he he...)!!

Thanx for helping me out here...

Take Care!

- -- ---[XaOs]--- -- -

Share this post


Link to post
Share on other sites