LWJGL
May 21, 2013, 13:52:22 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL is now using GitHub
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Texturing the outlines?  (Read 721 times)
Obsyd
Newbie
*
Posts: 26



« on: May 07, 2012, 13:54:19 »

Hello!

So my problem is that I would like to texture a triangle but the texture only appears inside the wireframe of the triangle. I also need to texture the wires(the outline of the triangle) that represent the triangle.
How can I do that?

Thank you!

The pink area is the picture that I get if I render the "green" triangle.  (basically its the inside of the green wire)
Logged
Simon Felix
Talks Too Much
***
Posts: 103



WWW
« Reply #1 on: May 07, 2012, 15:30:39 »

Are you just saying you want to texture a slightly bigger triangle?
Logged

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/
Obsyd
Newbie
*
Posts: 26



« Reply #2 on: May 07, 2012, 15:43:50 »

Not really.
I need to somehow texture the outlines.
I can't make the triangle bigger.

Maybe I can specify a different rasterization method?
Logged
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #3 on: May 08, 2012, 08:26:26 »

These calls set rendering to be wireframe or fill mode:

glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );

glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );

If you want to render both the polygon, and render the wireframe differently, I'd suggest rendering them both in a two-pass scenario.
Logged
Obsyd
Newbie
*
Posts: 26



« Reply #4 on: May 08, 2012, 09:52:09 »

Thank you CodeBunny!
It works! Smiley

Is there a mode where I don't need to "double" render? (I guess no)

Again,
Thanks!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!