View topic - GL help (edge of map widget)



All times are UTC + 1 hour


Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 22 Oct 2011, 11:42 
Zero-K Developer
User avatar

Joined: 14 Mar 2007, 03:44
Location: Fillydelphia
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?

Attachment:
screen00029.jpg [31.77 KiB]
Downloaded 2 times


Attachments:
File comment: (Supposed to) draw a VR grid around map
map_external_grid.lua [3.5 KiB]
Downloaded 90 times
Top
 Offline Profile  
 
PostPosted: 22 Oct 2011, 12:21 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
(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"


Attachments:
mapbla.jpg [225.18 KiB]
Downloaded 2 times
Top
 Online Profile  
 
PostPosted: 22 Oct 2011, 13:25 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
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)


Top
 Offline Profile  
 
PostPosted: 25 Oct 2011, 13:52 
Zero-K Developer
User avatar

Joined: 14 Mar 2007, 03:44
Location: Fillydelphia
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.


Top
 Offline Profile  
 
PostPosted: 25 Oct 2011, 14:08 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
maybe more suited for kernel panic?
still i think "map on grid" looks better than "map in void"


Top
 Online Profile  
 
PostPosted: 25 Oct 2011, 22:48 

Joined: 17 Sep 2008, 03:36
Location: your imagination
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.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.