Can i tell if a Vertex Tree is a solid shape?

  • Can i tell if a Vertex Tree is a solid shape? t123

    if a Vertex looks like this:

    struct vertex {
        vec3 point;
        vertex [] connected;

    Can I tell if this makes a solid shape with no holes? (e.g a sphere or a cube, NOT a sphere with a side missing for example)

    (if i can see the back of a face from outside of the shape then it is not solid)

  • This is quite a tricky question.

    My idea to test if an object has no hole is to check all edges and make sure they all belong to 2 different triangles. If an edge only belong to one triangle, it means it's a border of the whole surface, meaning there's a hole.

    This could be harder if you have different vertex at the same position (for example to have different texture coordinates per face).

c++ 3d mathematics 3d-meshes
Related questions and answers
  • for learning). I can load all the data into std::vectors but I don't know how to put it into an array of vertices and indices, so it's rendering wrong. Here's how it turns out with no culling and wireframe enabled (it's supposed to be a sphere, and that L shape in the middle isn't part of the model): When I tell it to render a point list, all the vertices are there in the right places... part, creating the vertex list... bool isDuplicate; for(int i = 0; i < polygonCount; i++) { for(int i2 = 0; i2 < 3; i2++) { isDuplicate = false

  • onscreen, in the shape of the terrain rectangle, but there are no regular lines etc. Here's the code I use for rendering: void ShaderProgram::Draw() { using namespace AntiMatter; if( ! m... in the shader code) for( int n = 0; n < vShaderArgs.size(); n ++) glBindAttribLocation( m_nProgramId, n, vShaderArgs[n].sFieldName.c_str() ); // Create and bind to a vertex array object, which... ); glBindVertexArray( m_nVaoHandle ); glDrawArrays( GL_TRIANGLES, 0, m_nNumTris ); glBindVertexArray(0); glUseProgram(0); } Can anyone see errors or omissions in either the VAO creation code

  • ); glScalef(0.5,5.0,0.5); glutSolidCube(1.0f); Can someone tell me what is wrong in it? I have got no idea what else I can do. ...I have got some problem in my OpenGL game. I am using bullet physics and I want to achive quite simple effect - I want one object (a sphere) to roll and hit another (box) which will fall down. I have got almost everything but still I have got some errors. When the box is hit it is rotating almost how I would like to. Well, almost means that when ball hits it it falls and rotates however

  • I have a very simple effect file shown below. I am using this to draw 2D lines, however it is not behaving how I expected and I can't seem to get my head round why. If I draw a line that goes from 0,0 to 100, 100 for example, I would expect it to draw a line from one corner of the screen to a little way in. I would expect it to treat these numbers as screen coordinates. Instead, the line is huge! A line of about 2 long fills the whole screen. Why is this? How can I modify my shader to 'think' in screen coordinates? // a struct for the vertex shader return value struct VSOut { float4 Col

  • ); m_pD3DDevice->RSSetState(m_pRSState); //...more code } WndProc: switch( message ) { case WM_SIZE: { m_pD3DDevice->RSSetState(m_pRSState); break; } } ...I am trying to create a ID3D10RasterizerState with direct3D10, and then call ID3D10Device::RSSetState() with the proper information. However, whenever the window get rescaled, or when the app goes fullscreen, the rasterizerstate seems to reset to the default state. I have tried to set the state with WM_SIZE messages, but awkwardly, nothing seems to happen... It works properly when I call

  • code shows the changes I made to get accurate physics. void GameState::createScene() { m_pSceneMgr->createLight("Light")->setPosition(75,75,75); // Physics // As a test we want a floor plane...::createScene() { m_pSceneMgr->createLight("Light")->setPosition(75,75,75); // Physics // As a test we want a floor plane for things to collide with Ogre::Entity *ent; Ogre::Plane p; p.normal = Ogre... the rigid body object btRigidBody *RigidBody = new btRigidBody(0, MotionState, Shape, LocalInertia); // Store a pointer to the Ogre Node so we can update it later RigidBody->setUserPointer((void

  • I'm working with SFML right now, and upon finishing the tutorials I still do not know how to give a shape a texture or image -- not just a solid color/outline. The only thing I know can take an image is a sprite, but thats way to simple, as it only allows you to render rectangular images in a rectangluar way! What are the techniques for rendering images onto shapes, and only inside the shape? It would be great if some of you could provide some resources or SFML-specific stuff!

  • I'm using vertex array to draw 2d geometry, but I can't achieve smoothness. This is the code I'm using: glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColorPointer(4, GL_UNSIGNED_BYTE, 0, shared_colors); glVertexPointer(3, GL_FLOAT, 0, shared_vertex); glDrawArrays(GL_LINES, 0, shared_counter); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisable(GL_BLEND); Some advice?

  • Right now im working on my c++ game, and im having alot of trouble using GLM and Bullet Physics to create my world correctly. The main problem is that when i export my physics with Blenderv2.57, and export my models for GLM, the models never line up with the physics correctly... Im wondering if there are any model loaders that would be good to use with Bullet Physics, and I can export... it up correctly.. heres the code: void BulletifyContinent(GLMmodel* mesh,float x,float y,float z,float scale) { btTriangleMesh* trimesh = new btTriangleMesh(); for(int t=0;t<mesh->

Data information