vertex

set of vertex-disjoint cycles so that each vertex belongs to a cycle

徘徊边缘 提交于 2021-02-07 20:56:59
问题 Here I have a directed graph G. I need to to determine whether there exists a set of vertex-disjoint cycles so that each vertex belongs to a cycle. I'm not sure if this can be done in polynomial time or if its NP-Complete? Can anyone atleast point me in the right direction? 回答1: Split each vertex into an "in" vertex and an "out" vertex. Then a vertex-disjoint cycle cover corresponds to a perfect matching on this graph. You can find out the answer to your question as fast as you can find

How can I find a list of all the uniforms in OpenGL es 2.0 vertex shader pro

喜你入骨 提交于 2020-06-09 17:07:05
问题 I'm trying to learn how to program vertex shaders. In Apple's sample project they have a line to set a glUniform1f(uniforms[UNIFORM_TRANSLATE], (Glfloat)transY); Then this value is used in // value passt in f // glUniform1f(uniforms[UNIFORM_TRANSLATE](Glfloat)transY); uniform float translate; void main() { gl_Position.y+=sin( translate); … I was unable to find a list of all uniforms of all the uniforms. Does any one know where I can find a list of all the uniforms and a good book or tutorial

How to give a mesh, vertex like self lighitng?

安稳与你 提交于 2020-01-15 15:48:07
问题 How we can give any complex mesh, vertex like self lighting. I tried increasing light ambient, material ambient, but as soon as it goes far it starts disappearing. I want that to be visible at whatever distance it is at. I have tried getting vertex from a cylinder then putting color in it, works fine for colors but fails at distance. have a look here and have a look at this too 来源: https://stackoverflow.com/questions/5700001/how-to-give-a-mesh-vertex-like-self-lighitng

ThreeJS: is it possible to simplify an object / reduce the number of vertexes?

蹲街弑〆低调 提交于 2020-01-13 11:23:10
问题 I'm starting to learn ThreeJS. I have some very complex models to display. These models come from Autocad files that my customer provides. But sometimes the amount of details in the model is just way too much for the purpose of the website. I would like to reduce the amount of vertexes in the model to simplify the display and enhance performance. Is this possible from within ThreeJS? Or is there maybe an other solution for this? 回答1: There's a modifier called SimplifyModifier that works very

Jung coloring vertex with value

余生颓废 提交于 2020-01-13 08:39:34
问题 I'm stuck at the moment with the Java library Jung. I display vertices and edges, only I can not find any functions for vertex coloring that I need with the value of the vertices and not with the mouse. import edu.uci.ics.jung.algorithms.layout.FRLayout; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.graph.Graph; import edu.uci.ics.jung.visualization.BasicVisualizationServer; import edu.uci.ics.jung.visualization.decorators.PickableVertexPaintTransformer; import edu

Is it possible to get the actual value of a vertex?

前提是你 提交于 2020-01-06 16:05:05
问题 I was trying to recover some vertex data from vertex shader, but I haven't found any relevant information about this on the internet. I'm using the vertex shader to calculate my vertex positions using the GPU, but I need to get the results for the logic of my application in Javascript. Is there a possible way to do this without calculating it in Javascript too? 回答1: In WebGL2 you can use transform feedback (as Pauli suggests) and you can read back the data with getBufferSubData although

Is it possible to get the actual value of a vertex?

不想你离开。 提交于 2020-01-06 16:04:11
问题 I was trying to recover some vertex data from vertex shader, but I haven't found any relevant information about this on the internet. I'm using the vertex shader to calculate my vertex positions using the GPU, but I need to get the results for the logic of my application in Javascript. Is there a possible way to do this without calculating it in Javascript too? 回答1: In WebGL2 you can use transform feedback (as Pauli suggests) and you can read back the data with getBufferSubData although

BGL: Using bundled properties to store vertex descriptor of another vertex

懵懂的女人 提交于 2020-01-05 11:15:10
问题 I am trying to create a tree graph using boost::adjacency list and bundled properties to store the parent for every vertex, I want to store vertex descriptors in a way that they wont invalidate in case I remove a vertex, so I use boost::listS , the code should look something like this // custom vertex for tree graphs struct tree_vertex_info{ // descriptor of parent vertex boost::graph_traits<Tree>::vertex_descriptor parent_in_tree; }; // the tree graph type typedef boost::adjacency_list<boost

Offset gl_Position or gl_Vertex by pixels value

拜拜、爱过 提交于 2020-01-04 06:45:47
问题 I have attribute contains pixels values. And i want to offset my gl_vertex with this attribute value. The problem is that my gl_vertex is in world units and the offset\attribute is in pixels. I can do it if i'm sending the screen size as uniforms and then convert the pixels to -1 to 1 values, and add it to the final gl_Position. But i don't want now to manage screen size events and sending it anyway every draw, every shader that i have. It there any way to do it with some matrix play, or