Object faces not matching up perfectly

Go down

Object faces not matching up perfectly

Post by ebennekom on Tue Feb 06, 2018 12:45 pm

Hi All

It's time for another newbie question.

So I'm modelling a building. Should be pretty straight forward since its basically just a 4 faced rectangle. I've made a texture that will cover all faces by wrapping around the rectangle.

In object viewer it looks correct. However, when placed in a route a tiny crack shows up between the vertical line where the first face starts and the last one ends. It seems to be just about 1 pixel, but it is there.



I've triple checked to make sure there is no blank pixel edge in the texture used.

Also tinkered about by setting the x coordinate to 0.99 instead of 1. That does solve it, but it also shifts the texture somewhat so the intersection isn't seemless.
So yeah.... I could use a tip/trick or a "you've screwed this or that up mate" from you guys.


Here's the code. I hope it's something obvious Embarassed 


Code:
[Meshbuilder]
vertex -25, 40, -10
vertex  25, 40, -10
vertex  25,  0, -10
vertex -25,  0, -10
vertex  25, 40,  10
vertex  25,  0,  10
vertex -25, 40,  10
vertex -25,  0,  10
vertex -25, 40, -10
vertex -25,  0, -10
face 0,1,2,3
face 1,4,5,2
face 4,6,7,5
face 6,8,9,7
[Texture]
coordinates 0, 0.0, 0
coordinates 1, 0.3, 0
coordinates 2, 0.3, 1
coordinates 3, 0.0, 1
coordinates 4, 0.5, 0
coordinates 5, 0.5, 1
coordinates 6, 0.8, 0
coordinates 7, 0.8, 1
coordinates 8, 1.0, 0
coordinates 9, 1.0, 0
load BenthemCrouwel1024x256.png

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Re: Object faces not matching up perfectly

Post by Delsin on Tue Feb 06, 2018 2:39 pm

Do you have transparency on texture edges? it's the most common reason.
avatar
Delsin

Posts : 106
Join date : 2016-08-20

Back to top Go down

Re: Object faces not matching up perfectly

Post by graymac on Tue Feb 06, 2018 2:53 pm

Delsin may have put his finger on the cause, particularly if it's transparent 255,255,255 or alpha transparency in use.

Your order of vertices confused me a little. Logical ordering helps troubleshooting when stuff goes wrong (as it inevitably will!!!) The mesh works, of course, what I can't see is how the texture functions as you haven't posted it (or a link to it).

On face ordering,  (screenie) from the "Eejits Guide":
avatar
graymac

Posts : 1946
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: Object faces not matching up perfectly

Post by Delsin on Tue Feb 06, 2018 3:09 pm

I guess "knitting" technique was used.

It doesn't really matter how faces are specified, only clockwise/anticlockwise direction is important to set normals correctly.

avatar
Delsin

Posts : 106
Join date : 2016-08-20

Back to top Go down

Re: Object faces not matching up perfectly

Post by ebennekom on Tue Feb 06, 2018 3:55 pm

Sorted!



I didn't think about the transparency as I thought there was none amongst the vertical lines. However, while scaling down the image to fit the ^2 rule some antialiasing must have occured.
So I copied some bits over to the outter edges making sure they are sharp. No transparency interference, and that did indeed solve the issue.

So thanks for the advice guys, you were absolutely spot on.

Also, graymac. I started out this building using 4 different meshbuilders, each defining one of the four faces of the object. It was looking at the code of one of your containers from the goods wagons package I realized it would be better to make 1 image, than wrap around.

Started out with 1 of the face I already had working and added the 3 others two it. But since it was an afterthought the silly order of vertices was just the result of not having a design, just adding to whats already there. I will however bear that in mind for the next object.

Also, Delsin. I did not know about the importance of the knitting technique. Didn't think normals would matter on a ehm.... well, shoebox basically. But I'm afraid I'd better revisit some of the others I've done now Very Happy

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Re: Object faces not matching up perfectly

Post by graymac on Tue Feb 06, 2018 7:14 pm

Started out with 1 of the face I already had working and added the 3 others two it. But since it was an afterthought the silly order of vertices was just the result of not having a design, just adding to whats already there. I will however bear that in mind for the next object.
As you have probably seen, I'm doing a train exterior (and interior) at present. It might seem an "old fashioned" way to go about it but I always have a pencil and paper handy, to record principal dimensions and to jot down a diagram of the face(s) to help number the vertices and mark in the coordinates that I've worked out from measuring the texture pixels in photoshop. Sometimes you need to go back to a part to adjust something and it helps if you know what's happened!! Never be afraid to make notes as you go Smile
avatar
graymac

Posts : 1946
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: Object faces not matching up perfectly

Post by ebennekom on Tue Feb 06, 2018 10:18 pm

> it helps if you know what's happened!

Totally agree. Luckily the objects I've made thus far weren't all that complex and keeping 'rallye notes' in the b3d's themselves was sufficient. For now I'll stick to updating what I've already done for some objects, and starting from scratch with others.

I hope some day to be confident enough  to start a real complex curvy locomotive, like the german E103 or something like that. I'll definitely need to draw that one out if/when I ever get to doing that.

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Re: Object faces not matching up perfectly

Post by SP1900 on Tue Feb 06, 2018 11:32 pm

I reckon it could be to do with the versions of openBVE and objectviewer you’re using. If they are of different versions it could be why the same object shows up differently. I use openBVE 1.5.2.1 and objectviewer 1.4.4.0 so I have similar problems. For example when I viewed a D stock train in objectviewer it had all sorts of transparency and vertex errors while in openBVE it turned out perfectly fine.
avatar
SP1900

Posts : 143
Join date : 2017-12-08
Location : Cambridge, England

Back to top Go down

Re: Object faces not matching up perfectly

Post by ebennekom on Wed Feb 07, 2018 10:27 am

Another facepalm moment overhere. Yeah, I am using a recent nightly for openbve and updated the taskbar link to it. But of course,.... never thought of updating the ones to route nor objectviewer -sigh-

It takes avast about an hour to clear these 'unknown proggries' before it will allow me to use them, but at least now everything is from the same build.

Thanks for the heads up sp1900 Very Happy

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Re: Object faces not matching up perfectly

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum