Page 1 of 1

GL help (edge of map widget)

Posted: 22 Oct 2011, 12:42
by KingRaptor
So, I modified knorke's widget here, hoping to make it draw a cool VR grid around the map (see attached file). Unfortunately I can't figure out how to apply the texture to the quads (drawn with gl.Vertex). Halp?
screen00029.jpg
(31.77 KiB) Downloaded 3 times

Re: GL help (edge of map widget)

Posted: 22 Oct 2011, 13:21
by knorke
(i have no good understanding of gl)
This one draws 4 textured quads around the map:
http://pastebin.com/EuuSsw75
also draws some (flowing!!11) river but you can just comment that out ;)
At the least it is maybe helpful to compare why that draws textures and yours does not.
*look*look*
I think you also need to use TexCoord to tell it how it should the put the texture over the vertices. You do not use it at all atm.

Might also just be that the texture path is not found:
local gridTex = "LuaUI/Images/vr_grid.png"
I do like paths this:
groundTextureFileName = "LuaUI\\widgets\\moss8.png"

Re: GL help (edge of map widget)

Posted: 22 Oct 2011, 14:25
by jK
You might want to take a look at glTexGen.
(It creates the texture coordinates from the vertex positions, and so it saves you those glTexCoord calls after each glVertex)

Re: GL help (edge of map widget)

Posted: 25 Oct 2011, 14:52
by KingRaptor
Well after some time fiddling with random bits like an idiot, I figured out how to use gl.TexCoord for what I wanted to do. So...done!

Image

Somehow it looked a lot cooler in my imagination :/ Ah well.

Re: GL help (edge of map widget)

Posted: 25 Oct 2011, 15:08
by knorke
maybe more suited for kernel panic?
still i think "map on grid" looks better than "map in void"

Re: GL help (edge of map widget)

Posted: 25 Oct 2011, 23:48
by luckywaldo7
Awesome.

Technically knorke it could fit any scifi game because even though you view the map from overhead, it doesn't really make sense for you to be a satellite or airborne unit if standard fog of war applies. What you are looking at is more likely a virtual display of the collective information accumulated from your various units.

So possibly you are looking at a display, or else the data is being fed directly into your brain and the resulting battlefield view is how it is interpreted.