Can anyone see the problem

HowardK
07-10-2002, 01:34 PM
I'm fairly new to directX, using V8.1.
The following code is based upon the tutorial supplied by MS with the SDK.
For some reason triangle 2 will not draw.

With Vertices(0): .x = x + width: .y = y: .z = z + length: .colour = &HFF000000: End With
With Vertices(1): .x = x: .y = y: .z = z: .colour = &HFF000000: End With
With Vertices(2): .x = x: .y = y: .z = z + length: .colour = &HFF000000: End With

With Vertices(4): .x = x: .y = y: z = z: .colour = &HFF00FF00: End With
With Vertices(5): .x = x + width: .y = y: z = z + length: .colour = &HFF00FF00: End With
With Vertices(3): .x = x + width: .y = y: z = z: .colour = &HFF00FF00: End With

x=0, y=0, z=0, width = 5, length = 5

This should lay out 2 triangles flat, in the shape of a square. Camera is positioned up abd back a few units. It shows only the first triangle, in black.
When a loop is used to lay out further triangles only the first halves show up.
I've tried allsorts, change the order of the vertices, the triangles etc. Only when the Y value for last point is changed to 1 does the triangle appear.
Banging my head on a brick wall only hurts my head !
Please someone, tell me I'm doing something stupid.

lebb
07-10-2002, 02:47 PM
In your last 3 vertex assignment lines, you reference z when I think you mean .z -- see if that helps. :)

ochensati
07-12-2002, 10:49 AM
Does the missing triangle apear if you look at it from the other side?

HowardK
07-15-2002, 03:54 AM
Bingo !

Couldn't see the wood for the trees.
Put in the dots and away she goes. All triangles present and correct.
Thank you for the help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum