Outlining Mesh? [SOLVED]

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Outlining Mesh? [SOLVED]

Post by Ravi08 »

Hi, was wondering if someone could point me in the correct direction of how to create a line on the egde of the mesh.

I have tried searching the forum with no luck.

Thanks for your time.
Last edited by Ravi08 on Sun Jul 04, 2010 12:13 pm, edited 1 time in total.
"Hey Baby Wobbling Wobbling"
-Russell Peters
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

i never try this but it probably will work.
use 2 same mesh nodes and parent the second to the first. set the second node's material flag to EMF_WIREFRAME.
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

Thanks Virion, i like your thinking. It works ok but what i really want is a red line going around the edge of my mesh.
"Hey Baby Wobbling Wobbling"
-Russell Peters
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

ohh sorry for misunderstood your question. you mean something like this?

Image

I think you'll need shader for that.
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

oh right, i was kinda hoping i didnt need to use a shader as my project is small.

Could u recommend a toon shader?
"Hey Baby Wobbling Wobbling"
-Russell Peters
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

I don't know how to do the outline, but i just want to show the sample of what i guess you are talking about -- http://www.jowood.com/games/silentstorm ... torm_1.jpg (green line -- is an outline).
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Post by PI »

If you only want an outline like the one on greenya's image, you can just render an other mesh scaled a little bit, flip its triangles and set a color to it without lighting.
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

Hi, greenya. Yea thats a perfect image to illustrate what im tryin to do
"Hey Baby Wobbling Wobbling"
-Russell Peters
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

Hi, PI. How would i set the colour?
"Hey Baby Wobbling Wobbling"
-Russell Peters
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

PI wrote:If you only want an outline like the one on greenya's image, you can just render an other mesh scaled a little bit, flip its triangles and set a color to it without lighting.
good idea :shock:
Kalango
Posts: 157
Joined: Thu Apr 26, 2007 12:46 am

Post by Kalango »

You can do this on your modelling program, you duplicate your models faces, invert them and scale(extrude) them using local normals. This is how outline used in games likeX-Men Legends are made. If you want to do this directly in Irrlicht, it will require some math knolege to execute the extrusion or the use of shaders.
PS: Doing that x-men legends thing you cant use alpha blending or alpha masks, because they will get glitched, you can notice that x-men legends characters dont use alpha masking.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Ravi08 wrote:Hi, PI. How would i set the colour?
set the emit color
PI
Posts: 176
Joined: Tue Oct 09, 2007 7:15 pm
Location: Hungary

Post by PI »

@Virion: Oh, come on, it's a very, very old idea... Maybe that's why I know it?!?! :oops:

@Kalango: And again: Oh, come on, he can do it in Irrlicht (without math knowledge or extruding), no need to use a modeling app and save it into an other file...!

@Ravi08: Every mesh scenenode has a material, grab it and overwrite its ambient color!

Cheers
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Post by Ravi08 »

@Pi: To be honest i was thinking about doing something similar to what Kalango said.

Anyway thank you all for your help, when i do this tommorrow ill post which method worked for me.

Thanks again :)
"Hey Baby Wobbling Wobbling"
-Russell Peters
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

Virion wrote:i never try this but it probably will work.
use 2 same mesh nodes and parent the second to the first. set the second node's material flag to EMF_WIREFRAME.
Sounds like z-fighting madness to me :)
beer->setMotivationCallback(this);
Post Reply