Crystal Space
9063 Posts in 2051 Topics by 77650 Members
Latest Member: Wangquan331
 Pages: [1]
 Author Topic: what is the correct vertex order in xml files?  (Read 2389 times)
Newbie

Posts: 8

 « on: December 10, 2007, 12:33:50 am »

Hi, I had some problems writing a simple xml world definition (couldn't see anything) till I found out the order in which I was describing the mesh was not correct. I've searched through the forum and manual (not exhaustingly), and I couldn't find any reference to how to describe the vertex. Is there any doc where it is explained? Than you.

Dan
 Logged
jorrit
Hero Member

Posts: 1706

 « Reply #1 on: December 10, 2007, 06:20:18 am »

A vertex is described as <v x="..." y="..." z="..." />.

Greetings,
 Logged
Newbie

Posts: 8

 « Reply #2 on: December 10, 2007, 06:45:22 am »

Yes, I mean the order... as describing a cube with

<v x="10" y="0" z="10"/>
<v x="10" y="0" z="-10"/>
<v x="-10" y="0" z="-10"/>
<v x="-10" y="0" z="10"/>
<v x="10" y="20" z="10"/>
<v x="10" y="20" z="-10"/>
<v x="-10" y="20" z="-10"/>
<v x="-10" y="20" z="10"/>

the order in which it is described is relevant (or, at least, when I altered this order the cube was not a cube). Is there a strict rule for the vertex?

Dan
 Logged
jorrit
Hero Member

Posts: 1706

 « Reply #3 on: December 10, 2007, 06:48:53 am »

The order of the vertices doesn't matter. What matters is the numbers you specify in the triangles below. So if you have a triangle that you want to make of the vertices at position 0, 4, and 5 then those three indices are important. If you change vertex order then you should also adapt the indices in the triangles.

Greetings,
 Logged
Newbie

Posts: 8

 « Reply #4 on: December 10, 2007, 06:51:22 am »

Ok, I understand now. Thank you very much!

Dan
 Logged
 Pages: [1]