Displaying a non-planar face
4 posters
Page 1 of 1
Displaying a non-planar face
Hello,
I remember this was not possible in BVE and openBVE as it was creating artifacts and the texture was never applied correctly. Is that still the case? Can it be fixed, or not at all?
Thanks. :-)
I remember this was not possible in BVE and openBVE as it was creating artifacts and the texture was never applied correctly. Is that still the case? Can it be fixed, or not at all?
Thanks. :-)
Last edited by Dexter on Sat Jul 20, 2019 9:07 pm; edited 2 times in total
Re: Displaying a non-planar face
I can't think why it wouldn't work, certainly shouldn't be any technical reason why not.
If you find it doesn't, produce a simple example and I'll take a look.
If you find it doesn't, produce a simple example and I'll take a look.
Re: Displaying a non-planar face
Well, this has a concave part and it does not display properly with a rectangular texture.
The shape of the object gets f***** up...
Yet when I separate the Meshes, it gets displayed normally... there is no difference between the two in terms of shape.
I believe it's the marked angle that causes the problem (the frame is taken from the separate meshes version, otherwise it wouldn't have been displayed)
- Code:
;;sleeper1
CreateMeshBuilder,
Addvertex,-0.76, -0.169, 0.295,
Addvertex,-0.76, -0.169, 0.491,
Addvertex,-0.63, -0.169, 0.491,
Addvertex,-0.35, -0.195, 0.491,
Addvertex,0.35, -0.195, 0.491,
Addvertex,0.63, -0.169, 0.491,
Addvertex,0.76, -0.169, 0.491,
Addvertex,0.76, -0.169, 0.295,
Addvertex,0.63, -0.169, 0.295,
Addvertex,0.35, -0.195, 0.295,
Addvertex,-0.35, -0.195, 0.295,
Addvertex,-0.63, -0.169, 0.295,
AddFace,0,1,2,3,4,5,6,7,8,9,10,11
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0, 1,
SetTextureCoordinates,1, 0, 0,
SetTextureCoordinates,2, 0.1, 0,
SetTextureCoordinates,3, 0.28, 0,
SetTextureCoordinates,4, 0.72, 0,
SetTextureCoordinates,5, 0.9, 0,
SetTextureCoordinates,6, 1, 0,
SetTextureCoordinates,7, 1, 1,
SetTextureCoordinates,8, 0.9, 1,
SetTextureCoordinates,9, 0.72, 1,
SetTextureCoordinates,10, 0.28, 1,
SetTextureCoordinates,11, 0.1, 1,
The shape of the object gets f***** up...
Yet when I separate the Meshes, it gets displayed normally... there is no difference between the two in terms of shape.
- Code:
CreateMeshBuilder,
Addvertex,-0.76, -0.169, 0.295,
Addvertex,-0.76, -0.169, 0.491,
Addvertex,-0.63, -0.169, 0.491,
Addvertex,-0.63, -0.169, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0, 1,
SetTextureCoordinates,1, 0, 0,
SetTextureCoordinates,2, 0.1, 0,
SetTextureCoordinates,3, 0.1, 1,
CreateMeshBuilder,
Addvertex,-0.63, -0.169, 0.295,
Addvertex,-0.63, -0.169, 0.491,
Addvertex,-0.35, -0.195, 0.491,
Addvertex,-0.35, -0.195, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.1, 1,
SetTextureCoordinates,1, 0.1, 0,
SetTextureCoordinates,2, 0.28, 0,
SetTextureCoordinates,3, 0.28, 1,
CreateMeshBuilder,
Addvertex,-0.35, -0.195, 0.295,
Addvertex,-0.35, -0.195, 0.491,
Addvertex,0.35, -0.195, 0.491,
Addvertex,0.35, -0.195, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.28, 1,
SetTextureCoordinates,1, 0.28, 0,
SetTextureCoordinates,2, 0.72, 0,
SetTextureCoordinates,3, 0.72, 1,
CreateMeshBuilder,
Addvertex,0.35, -0.195, 0.295,
Addvertex,0.35, -0.195, 0.491,
Addvertex,0.63, -0.169, 0.491,
Addvertex,0.63, -0.169, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.72, 1,
SetTextureCoordinates,1, 0.72, 0,
SetTextureCoordinates,2, 0.9, 0,
SetTextureCoordinates,3, 0.9, 1,
CreateMeshBuilder,
Addvertex,0.63, -0.169, 0.295,
Addvertex,0.63, -0.169, 0.491,
Addvertex,0.76, -0.169, 0.491,
Addvertex,0.76, -0.169, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.9, 1,
SetTextureCoordinates,1, 0.9, 0,
SetTextureCoordinates,2, 1, 0,
SetTextureCoordinates,3, 1, 1,
I believe it's the marked angle that causes the problem (the frame is taken from the separate meshes version, otherwise it wouldn't have been displayed)
Re: Displaying a non-planar face
I changed the topic name as it seems the problem is not the texture itself, but the actual render displaying the set of verticies incorrectly. It creates some bizarre messed up shape as you can see.
Re: Displaying a non-planar face
This is not working either, it displays broken...
- Code:
CreateMeshBuilder,
Addvertex,-0.63, -0.169, 0.295,
Addvertex,-0.63, -0.169, 0.491,
Addvertex,-0.35, -0.195, 0.491,
Addvertex,0.35, -0.195, 0.491,
Addvertex,0.63, -0.169, 0.491,
Addvertex,0.63, -0.169, 0.295,
Addvertex,0.35, -0.195, 0.295,
Addvertex,-0.35, -0.195, 0.295,
AddFace,0,1,2,3,4,5,6,7
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.1, 1,
SetTextureCoordinates,1, 0.1, 0,
SetTextureCoordinates,2, 0.28, 0,
SetTextureCoordinates,3, 0.72, 0,
SetTextureCoordinates,4, 0.9, 0,
SetTextureCoordinates,5, 0.9, 1,
SetTextureCoordinates,6, 0.72, 1,
SetTextureCoordinates,7, 0.28, 1,
Re: Displaying a non-planar face
I might be doing something wrong, but it seems that a non-planar face is displayed as something broken.
Re: Displaying a non-planar face
This (below) is not working either and creates a weirdly displayed thing. Weirdly textured as well. You can try all the examples with your random rectangular texture (no transparency).
Separate meshes with same shape work as intended:
- Code:
CreateMeshBuilder,
Addvertex,-0.76, -0.21, 0.295, ;0
Addvertex,-0.76, -0.169, 0.295, ;1
Addvertex,-0.63, -0.169, 0.295, ;2
Addvertex,-0.35, -0.195, 0.295, ;3
Addvertex,0.35, -0.195, 0.295, ;4
Addvertex,0.63, -0.169, 0.295, ;5
Addvertex,0.76, -0.169, 0.295, ;6
Addvertex,0.76, -0.21, 0.295, ;7
AddFace,0,1,2,3,4,5,6,7
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0, 0.9,
SetTextureCoordinates,1, 0, 1,
SetTextureCoordinates,2, 0.1, 1,
SetTextureCoordinates,3, 0.28, 1,
SetTextureCoordinates,4, 0.72, 1,
SetTextureCoordinates,5, 0.9, 1,
SetTextureCoordinates,6, 1, 1,
SetTextureCoordinates,7, 1, 0.9,
Separate meshes with same shape work as intended:
- Code:
CreateMeshBuilder,
Addvertex,-0.76, -0.21, 0.295,
Addvertex,-0.76, -0.169, 0.295,
Addvertex,-0.63, -0.169, 0.295,
Addvertex,-0.63, -0.21, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0, 0.9,
SetTextureCoordinates,1, 0, 1,
SetTextureCoordinates,2, 0.1, 1,
SetTextureCoordinates,3, 0.1, 0.9,
CreateMeshBuilder,
Addvertex,-0.63, -0.21, 0.295,
Addvertex,-0.63, -0.169, 0.295,
Addvertex,-0.35, -0.195, 0.295,
Addvertex,-0.35, -0.21, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.1, 0.9,
SetTextureCoordinates,1, 0.1, 1,
SetTextureCoordinates,2, 0.28, 1,
SetTextureCoordinates,3, 0.28, 0.9,
CreateMeshBuilder,
Addvertex,-0.35, -0.21, 0.295,
Addvertex,-0.35, -0.195, 0.295,
Addvertex,0.35, -0.195, 0.295,
Addvertex,0.35, -0.21, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.28, 0.9,
SetTextureCoordinates,1, 0.28, 1,
SetTextureCoordinates,2, 0.72, 1,
SetTextureCoordinates,3, 0.72, 0.9,
CreateMeshBuilder,
Addvertex,0.35, -0.21, 0.295,
Addvertex,0.35, -0.195, 0.295,
Addvertex,0.63, -0.169, 0.295,
Addvertex,0.63, -0.21, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.72, 0.9,
SetTextureCoordinates,1, 0.72, 1,
SetTextureCoordinates,2, 0.9, 1,
SetTextureCoordinates,3, 0.9, 0.9,
CreateMeshBuilder,
Addvertex,0.63, -0.21, 0.295,
Addvertex,0.63, -0.169, 0.295,
Addvertex,0.76, -0.169, 0.295,
Addvertex,0.76, -0.21, 0.295,
AddFace,0,1,2,3
LoadTexture,Prazec1.png,
SetTextureCoordinates,0, 0.9, 0.9,
SetTextureCoordinates,1, 0.9, 1,
SetTextureCoordinates,2, 1, 1,
SetTextureCoordinates,3, 1, 0.9,
Re: Displaying a non-planar face
Oh! Now I get what you're trying to do. No, faces have to be planar, non-planar faces aren't possible. The border vertices don't define the face, the renderer can't know how to connect which vertices. You'll always have to break those down.
Quork- Posts : 1438
Join date : 2012-05-05
Age : 32
Location : Hofheim a.T., Hessen (Hesse), European Union
Re: Displaying a non-planar face
I had the same thing on carriage roof corners where I had to show double curvature, the answer was to break it down in to triangles. With a custom normal or two thrown in the result was acceptable.
Re: Displaying a non-planar face
Yeah, I believe "double curvature" is the correct reference. It is very unfortunate this cannot be done.
Anyhow, the last example is actually planar, the problem there is the concave angle... Chris mentioned that should be working.
Re: Displaying a non-planar face
I think what you're forgetting is the winding of the face.
Think of it as a connect the dots puzzle working in threes, which must *always* go anti-clockwise to produce correct results.
Anything enclosed by the current set of three dots will be filled.
openGL in general just doesn't work the way you're trying to make it.
Think of it as a connect the dots puzzle working in threes, which must *always* go anti-clockwise to produce correct results.
Anything enclosed by the current set of three dots will be filled.
openGL in general just doesn't work the way you're trying to make it.
Similar topics
» 2D panels not displaying in recent builds
» The Face and Face2 Commands
» One complex face vs. several simpler faces
» Suggestion: Mirrored face command
» The Face and Face2 Commands
» One complex face vs. several simpler faces
» Suggestion: Mirrored face command
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|