thnx ill look into that
hehe ya i tryed some software drawing myself at first.. Waaaaaay to slow
Thats why i changed to dx.
but it looks to me like u are using textures or is it just colors? really look like its textured
Looked at that page Lesson 2 is missing its lesson 1,6 and up
Oh and i forgot to mention im using VB.Net if u know any tutorials on opengl for VB im gonna run over to u and giveu a big big hug :P
ok that hug is otw
found the vb code on that page
ok i got that opengl and the .net stuff needed.. i got it to run with the sample and then i changed it to draw the track..
This is how i do it..
For each object block i do this:
gl begin.
then i get all triangles in that onbject and loads them setting color and xyz
then i do
GL.glEnd
and do this for each block
it loads without errors but the screen is black and no objects are shown.. am i doing something wrong?
i do call the gl draw func after im done adding the objects
hmm.. just noticed the values for x y z are extremly big.. maybe this is why it wont work.. any idea how to make them smaler without destroying the layout of the track.. i tryed x / 150000 that made it visible only if also used the translate and moved it in to my screen.. but it was still waaaay to big and i know that if i use a number higher than 150000 its no good cause using integers it will round it of so most triangles will have abc at the same value
EDIT:
How in the world do u manage to render it.. my gues is u dont loop threw every triangle for each render.. is there a function that takes arrays that im not aware of ? lol
could u make the source for the function where u load it in to directx avalible plz.. im totally off here.. or maybe Victor could make an example.. this looks really confusing to me..
u displayed the whole track at once... thats alot of vertex to load.. did u add each object as a mesh or did u load all vertex (triangles) under 1 mesh / object..
I get memory error and stack overflow all the time i dont know how u managed to load all that... im using the indexbuffer and vertexbuffer atm.. and it aint going to well..
did i miss something.. its over 200k vertex on bl1 thats about 90k+ meshes and thats waaay to much.. or maybe its just me being stupid..
Anyways.. would be great if someone could give me a hint on how to load it cause im pretty sure im doing it wrong..
heres a sample of the code im using atm
ReDim Track(SM.Header.Objects.Count - 1)
ReDim mymesh(SM.Header.Objects.Count - 1)
Dim cv AsInteger
cv = 0
cc = 0
For X = 0 To (SM.Header.Objects.Count - 1) Step 1
o = SM.Header.Objects(X)
mymesh(X) = New MeshClass
ReDim mymesh(X).Vert(0 To o.Points.Count - 1)
ReDim mymesh(X).Tris(0 To (o.Tris.Count * 3) - 1)
For Y = 0 To o.Points.Count - 1
mymesh(X).Vert(Y) = New Direct3D.CustomVertex.TransformedColored
mymesh(X).Vert(Y).Color = RGB(o.Points(Y).cRed, o.Points(Y).cGreen, o.Points(Y).cBlue)
mymesh(X).Vert(Y).X = o.Points(Y).X
mymesh(X).Vert(Y).Y = o.Points(Y).Y
mymesh(X).Vert(Y).Z = o.Points(Y).Z
' mymesh(X).Vert(Y).Rhw =
Next
cc = 0
For Y = 0 To o.Tris.Count - 1
mymesh(X).Tris(cc) = o.Tris(Y).VertexC
cc = cc + 1
mymesh(X).Tris(cc) = o.Tris(Y).VertexB
cc = cc + 1
mymesh(X).Tris(cc) = o.Tris(Y).VertexA
cc = cc + 1
Next
Track(X) = New Direct3D.Mesh(UBound(mymesh(X).Tris) + 1, UBound(mymesh(X).Vert) + 1, MeshFlags.Managed, Direct3D.CustomVertex.PositionColored.Format, mobjDX9)
Next
For X = 0 To UBound(Track)
Track(X).SetIndexBufferData(mymesh(X).Tris, LockFlags.NoOverwrite) 'memory error here if array is 500 or more maybe abit below that.. but it crashes at object 27 and 28.. they are extremly big compared to the others
Track(X).SetVertexBufferData(mymesh(X).Vert, LockFlags.NoOverwrite)
Next