BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Objects - problem with vertices

5 posters

Go down

Objects - problem with vertices Empty Objects - problem with vertices

Post by liquid_ Mon Sep 17, 2012 12:00 pm

Could someone tell me what the problem is with below object definition?
CreateMeshBuilder
AddVertex,0.7275,-0.000400684,0 ;0
AddVertex,0.743,0,0 ;1
AddVertex,0.764,0,0 ;2
AddVertex,0.7795,-0.000400684,0 ;3

AddVertex,0.7275,-0.000400684,3 ;4
AddVertex,0.743,0,3 ;5
AddVertex,0.764,0,3 ;6
AddVertex,0.7795,-0.000400684,3 ;7

AddFace,0,4,5,1
AddFace,1,5,6,2
AddFace,2,6,7,3

CreateMeshBuilder
AddVertex,0.7275,-0.000400684,0 ;0
AddVertex,0.7175,-0.0143,0 ;1
AddVertex,0.7275,-0.000400684,3 ;2
AddVertex,0.7175,-0.0143,3 ;3

AddVertex,0.7795,-0.000400684,0 ;4
AddVertex,0.7895,-0.0143,0 ;5
AddVertex,0.7795,-0.000400684,3 ;6
AddVertex,0.7895,-0.0143,3 ;7

AddFace,1,3,2,0
AddFace,4,6,7,5 ; error: nonexisting vertex

SetColor,122,122,122


liquid_

Posts : 26
Join date : 2012-05-15

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by mobile1 Mon Sep 17, 2012 12:21 pm

Hi, what are you tying to produce, all that you have written produces a single line in object viewer, have you looked at object construction on the forum
mobile1
mobile1

Posts : 136
Join date : 2011-08-22

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by Dexter Mon Sep 17, 2012 12:43 pm

1) Try to use a maximum of 3 decimal places (millimeter accuracy) unless absolutely necessary to use more.
2) You are missing the "SetColor" command after the first set of AddVertex + AddFace, it has to be defined separately for each set.


Last edited by Derryck on Wed Sep 19, 2012 11:24 am; edited 1 time in total
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by tof63 Mon Sep 17, 2012 11:17 pm

liquid_ wrote:Could someone tell me what the problem is with below object definition?
CreateMeshBuilder
AddVertex,0.7275,-0.000400684,0 ;0
AddVertex,0.743,0,0 ;1
AddVertex,0.764,0,0 ;2
AddVertex,0.7795,-0.000400684,0 ;3

AddVertex,0.7275,-0.000400684,3 ;4
AddVertex,0.743,0,3 ;5
AddVertex,0.764,0,3 ;6
AddVertex,0.7795,-0.000400684,3 ;7

AddFace,0,4,5,1
AddFace,1,5,6,2
AddFace,2,6,7,3

CreateMeshBuilder
AddVertex,0.7275,-0.000400684,0 ;0
AddVertex,0.7175,-0.0143,0 ;1
AddVertex,0.7275,-0.000400684,3 ;2
AddVertex,0.7175,-0.0143,3 ;3

AddVertex,0.7795,-0.000400684,0 ;4
AddVertex,0.7895,-0.0143,0 ;5
AddVertex,0.7795,-0.000400684,3 ;6
AddVertex,0.7895,-0.0143,3 ;7

AddFace,1,3,2,0
AddFace,4,6,7,5 ; error: nonexisting vertex

SetColor,122,122,122

- The object is syntactically correct.
- Omissing the SetColor statement is like setting SetColor,255,255,255 (white surface)
- The first CreateMeshBuilder section, corresponding to three adjacent and coplanar surfaces, can be semplified with the same visual result by defining a single surface with this alternative code:
Code:
CreateMeshBuilder
AddVertex,0.7275,-0.000400684,0
AddVertex,0.7795,-0.000400684,0

AddVertex,0.7275,-0.000400684,3
AddVertex,0.7795,-0.000400684,3

AddFace,2,3,1,0
This because the difference between 0 and 0.000400684 (less then 1 mm) is virtually not visible.

So the problem depends only on what you mean in practice reproduce, but I can't figure what it can be.
tof63
tof63

Posts : 40
Join date : 2012-05-08
Location : Turin (Italy)

http://bve.altervista.org/index.html

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by Dexter Tue Sep 18, 2012 6:00 am

tof63 wrote:
- Omissing the SetColor statement is like setting SetColor,255,255,255 (white surface)

Sure, but then it really depends on what he is creating (perhaps it is a packet of chlorinated lime, who knows), as not many things are brilliantly white in real life. Smile By the way, good to see you around, Luigi. Smile
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 38
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by mrknowitall Tue Sep 18, 2012 7:45 am

The values simply don't make sence. You should always use a maximum of 0.0x value, anything more is silly and a waste of time, same with your coordinates, always go to point 3, (o.xxx) nothing more is needed.

mrknowitall
mrknowitall

Posts : 824
Join date : 2011-07-09
Age : 31
Location : W. Yorkshire

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by liquid_ Tue Sep 18, 2012 9:12 pm

I think the problem was in wrong character written to the file around vertex 6. When I looked at the file on Linux there wasn't new line character there.
Anyway, thanks a lot for help.
You may be right saying that too much accuracy is waste of time but Object Bender does the same thing: evaluates new coordinates with full accuracy.
For those who were wondering what I was doing I attached the file. It's the most beautiful rail Wink I've ever seen on BVE railroads. Of course, some may say it was also wasting the time but I wanted to get some practice in making objects from vertices and faces.
Attachments
Objects - problem with vertices Attachment
rail3m.csv.zip You don't have permission to download attachments.(1 Kb) Downloaded 8 times

liquid_

Posts : 26
Join date : 2012-05-15

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by tof63 Wed Sep 19, 2012 9:53 am

tof63 wrote:So the problem depends only on what ...
Copyng and pasting to/from the forum hid the problem to us.

My best congratulations!
You have learned well the BVE object language writing its code in an elegant way, in contrast to those who complain the absence of a visual program to build objects...
tof63
tof63

Posts : 40
Join date : 2012-05-08
Location : Turin (Italy)

http://bve.altervista.org/index.html

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by liquid_ Wed Sep 19, 2012 12:02 pm

tof63 wrote:Copyng and pasting to/from the forum hid the problem to us.
It was also hidden to me as Windows displayed the contents correctly.

tof63 wrote:My best congratulations!
You have learned well the BVE object language writing its code in an elegant way, in contrast to those who complain the absence of a visual program to build objects...
Well, it's not very easy but makes a lot of fun though.

liquid_

Posts : 26
Join date : 2012-05-15

Back to top Go down

Objects - problem with vertices Empty Re: Objects - problem with vertices

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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