Vertexx() and co

Blitz3D Forums/Blitz3D Programming/Vertexx() and co

Hujiklo(Posted 2005) [#1]
As I understand it the vertexx,y,z commands return the world coordinate of the current vert of a surface at which ever index.
I made a simple flat quad so it stood vertically like a wall and popped it into my game world.
I check the surface - get the 4 verts.

(For reasons I won't go into here - I actually need to rotate the quad 90 degrees on the y, which is what I've done)

The problem I'm getting is that the vertex x,y,z's seem to bear no relation to the the real world coordinates which are printed to screen depending on where my dummy player object is(this dummy is specifically to cross check coordinates). Infact I'm getting some garbage coordinates that have me bewildered. It seemed so straight forward as there are only 4 verts to check.

Is there something I'm missing?

Also - is there a way to control vert order? As the verts of a flat mesh are cycled through I notice that there seems to be a hiccup in their order. They generally start from one end of the mesh or other but for some reason will then miss a few verts and select an 'odd' vert before returning to back to where it last left off. I assumed that a conversion to b3d would arrange the vert list in some sort of logical order but it seems not to be so.


Bouncer(Posted 2005) [#2]
If I remember correctly, the vertex(x/y/z) commands return the co-ordinates relative to the entity, so you need to tfrompoint() to the world co-ords.


Hujiklo(Posted 2005) [#3]
Thanks Bouncer! You got me back on track...

Sigh! the more I go at this game alone the more tunnel vision I seem to get.
It would really help to have another blitzer in the same room at all times!!


Hujiklo(Posted 2005) [#4]
Anybody know anything about vertex order?

I'm putting a sine wave through a horizontal flat mesh. It's
to give the effect of a sliced view of water for a platformer so the mesh is only one quad 'thick' into the screen and about 50 quads across it.
I have it working save for the odd vertex which is out of synch with its closest neighbour. I'm simply going through the surface from zero to countvertices.

I don't see how I can either control during creation in Max or in Blitz the vertices index order....I can just see that somewhere there is spanner in the works and that as I count through them the 'visual' vert order is leap frogged from time to time but always in the same place.


doctorskully(Posted 2005) [#5]
I don't really know much about vertex order, but would that sine wave work with a terrain? That could probably be easier...and maybe (if you do need it to be a mesh) instead of using 0 to CountVertices()-1, you could use the x and z coords to find each vertex instead of relying on the order.


Stevie G(Posted 2005) [#6]
The order of vertices on a surface is the same as the order you created them. Unless you're using addmesh ... for this I couldn't be sure how if they are re-ordered.

Show us your code and I'm sure we'll be able to get this working for you.


Hujiklo(Posted 2005) [#7]
I did get it working thanks. I just have to be more careful when creating the water surface plane in Max - no adding quads manually and welding etc.
I thought if I copied a manually modified mesh that 3DSMax would automatically re-order the verts as newly created object but it seems to copy them in the exact order they were originally created down to the last vert.

Well it's working now - thanks for all your help.

Deep - I didn't want to do a terrain as I really want to use Max as a map editor so it helps to see my individual objects.