Highlight polygons of a mesh

Return to C++ coding using Panda3D

Highlight polygons of a mesh

Postby Gogg » Mon Oct 12, 2009 8:36 pm

I'm doing a terrain editor, my terrain is just a mesh constructed procedurally with triangles, and I would like to highlight some triangles, in bright green or something, to have some kind of selection and operate on it. What's the better approach for this in c++?
User avatar
Gogg
 
Posts: 475
Joined: Thu Sep 24, 2009 1:06 pm

Postby drwr » Mon Oct 12, 2009 9:39 pm

You can duplicate (or instance, if it's within a single Geom or GeomNode) the geometry into the scene graph, with a new state to make it render in the effect you like. This is, for instance, how the 'h' key works to highlight geometry in pview. (Press 'h', then the down/left/right arrows, to walk the scene graph in pview and see the highlight.)

David
drwr
 
Posts: 11253
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA


Return to C++ coding using Panda3D

Who is online

Users browsing this forum: No registered users and 0 guests