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?
GL help (edge of map widget)
Moderator: Moderators
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
GL help (edge of map widget)
- Attachments
-
- map_external_grid.lua
- (Supposed to) draw a VR grid around map
- (3.5 KiB) Downloaded 106 times
Re: GL help (edge of map widget)
(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"
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"
- Attachments
-
- mapbla.jpg
- (225.18 KiB) Downloaded 3 times
Re: GL help (edge of map widget)
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)
(It creates the texture coordinates from the vertex positions, and so it saves you those glTexCoord calls after each glVertex)
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
Re: GL help (edge of map widget)
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!

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

Somehow it looked a lot cooler in my imagination :/ Ah well.
Re: GL help (edge of map widget)
maybe more suited for kernel panic?
still i think "map on grid" looks better than "map in void"
still i think "map on grid" looks better than "map in void"
-
- Posts: 1398
- Joined: 17 Sep 2008, 04:36
Re: GL help (edge of map widget)
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.
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.