alessio_pi_

Members
  • Content count

    29
  • Joined

  • Last visited

Community Reputation

123 Neutral

About alessio_pi_

  • Rank
    Member
  1. mass spring mesh

    Thanks very much for reply. I would like implement the model describe in the article but I don't understand how to set up the model and how solve the equation. My idea was try to apply the model describe from the article on a mesh with few vertex and triangles, and my initial example was related to it. If someone can help me to implement this model I appreciate.   Thanks to all.
  2. mass spring mesh

    Sorry I find this formula in this article I need implement a similar behavior with my obect I need to fix constrain on vertex. I would move some vertex and calculate the deformation of my object using mesh spring system. Can you help me to model the system?   http://www.ecti-thailand.org/assets/papers/1116_pub_36.pdf
  3. mass spring mesh

    I would like represent my object as mass spring mesh to simulate soft body dynamics. Mass represent  vertex while edge represent spring that connect two adjacent vertex. I I draw a this simple example to explain my problem.   https://plus.google.com/photos/107455303756077315255/albums/5979121850686148337/5979121849500531026?banner=pwa&pid=5979121849500531026&oid=107455303756077315255     I have four mass m1,m2,m3,m4 and know the values and their positions. I know the stiffness coefficient kij and dumping coefficient cij of mesh springs where i and j are the vertex index.   In figure 1 the system is in the rest position. In figure 2 after apply a force to m4 point the system change configuration,   The user move the m4 point from figure 1 to figure 2 position. A force applied to m4 move the mass m4. m1 mass rest in the same position again in figure 2 while mass m2 e m3 have a new position. I would like calculate the new position of m2 and m3 mass after that user move the m4 mass. I know the formula about Fi_int the internal force on the vertex i and the damping force Fi_ext on the vertex. Please help me solve this problem.          
  4. deformation question...

    I read this article and it's very interesting.   https://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDYQFjAA&url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.124.3856%26rep%3Drep1%26type%3Dpdf&ei=xB1IUYqQIMiR7Aav04HQDQ&usg=AFQjCNFp2S9gAcCMX8vOKnuTC-rM5WKmEA&sig2=CDlXQWYcOxdUOx6bTML3cw   I would implement an animation tool following this article. I saw the video of the article and the tool developed its very user-friendly.   But I am confused and I trying understand how deformation graph should be modified. and how could be the mainloop about minimization.   I think the weight of vertex should be precalculated and  I should understand how deformation graph should be modified to calculate the final vertex. Someone can help me?
  5. which spatial indexing structure needs?

    [quote name='LorenzoGatti' timestamp='1354180098' post='5005235'] If I understand correctly, you need to validate all points at every attempted change: the maximum distance between each point and its closest neighbour cannot exceed a given threshold [i]d[/i]. Good news: it is quite a bit cheaper than maintaining or computing nearest neighbours. Is [i]d[/i] constant? Assuming [i]d[/i] is constant, a uniform grid of cubes with edges of length [i]d[/i] (possibly compacted with hashing from many grid cubes to few buckets) storing the list of contained points should be a simple way to limit the cost of each update. After adding and removing points in the appropriate cells, the only points that might have lost a nearest neighbour within distance [i]d[/i] (possibly becoming invalid) are those in the cells from which you deleted points, and the 26 adjacent ones (take care to process each cell only once). For each point in those cells you need to find a close enough point, which requires you to search only 27 cells. Of course if a point has become invalid you can undo your additions and deletions. In addition to the basic spatial index, you can invest memory to search even less. Associate every point P with a list of the "dependent" points that are valid because a previous search has found P to be close enough to them: when you delete P, only the points in its list of dependents might have become invalid (if P was the only point that was close enough) and require a new search (which, if successful, will add them to the dependent lists of other points). [/quote] Yes the threshold d can be fixed. I could build an uniform grid of cubes but I don't understand how update and remove point from the grid. if the the edge cell have size d, before I find the cell where point is in and to find the closest point with distance <d, I should check the adjacent cell of the grid o no? Insertion and deletion what's operation needs? Find the right cell and remove or insert new point? What's happen if the new point inserted is out the bbox of the initial grid. How is it inserted?
  6. which spatial indexing structure needs?

    [quote name='Bacterius' timestamp='1354131738' post='5005046'] You mean, you need to find the two points A, B such that A and B are closest for any possible (A, B) pair? Do you just need to add and remove items, or is the [i]entire[/i] dataset changing occasionally? And how often? A self-balancing kd-tree was the first thought that crossed my mind, but if most of your dataset is continually changing, I don't think any spatial structure will do - in general, data needs to be constant for them to be of any use (because it takes time to build them, too). [/quote] I should check that points in front to another points don't exceed a minimun distance. Maybe I should not check every points against all, but only a part of dataset. For every iteration can happen: 1) one point is deleted from the dataset 2) one point deleted and 1 new point added 3) one point deleted and 2 new point added I need data structure that permit do it fast. My initial dataset can have from 200 to 1000 3d points more or less. Thanks.
  7. Hello, I have a set of 3d points and this set can change dynamically as the number and location. I need to find for every iteration the closest pair of points set.I thought some spatial index structure because it's very expensive for every iteration check the closest pair of points. I need of spatial indexing structure that can dynamic update the points dataset, delete a point from the dataset, and a fast search for closest point. Thanks in advance.
  8. create a bridge on mesh

    [quote name='apatriarca' timestamp='1350391675' post='4990696'] [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img] Is the screenshot taken from [url="http://meshlab.sourceforge.net/"]MeshLab[/url]? It's an open-source software and you can thus probably see how the feature is implemented. [/quote] yes the screenshot but the bridge is did with another sw and it's not opensource :|
  9. create a bridge on mesh

    [quote name='HappyCoder' timestamp='1350366679' post='4990633'] Being that there are many solutions to your problem, you will need to add additional constraints before coming up with a solution. So elaborate more on what you actually need. >For example, how will you choose the two edges you want to connect? Will the space between them be clear? for the moment the user select two edge of the hole. >What resolution do you need the bridge to be? The important it's preserving the original model features, I think I should follow the curvature of the near of the hole. Look my link there is a picture as the bridge should be. >Does the transition between the edge to the bridge have to be smooth or can the joint between the pieces be angular? Does the bridge need to be curved? yes bridge need to be curved. transition between the edge and bridge should be smooth. But the bend that the bridge have, should be realistic and preserving the shape of the model. For example can't be a simple linear interpolation.... I think I should force the curvature of the bridge in some way but I again understand how... [/quote]
  10. create a bridge on mesh

    Hello, I would like create a bridge on my triangular mesh. Given two edge of one hole I would like create a bridge between them. I have no idea how do it. This is an example get from one sw that have this feature. https://plus.google.com/photos/107455303756077315255/albums/5799436635023575809 Thanks in advance.
  11. change coordinate system in object space

    Quote: You say you translate the object space coordinate system by (-3,-1,0), you mean that your translate the origin of the object space coordinate system so that it is now positioned at (8,4,0) relative to the world space coordinate system? If so, then your vertex position is still (3,2,0) relative to the object space but the vertex position relative to the world space has then become (11,6,0). Am I missing something here? No I must keep fix the vertex coordinate respect to word space. The object must stay in a fix position. I want move only the origin about object space coordinate system. A sketch for to understand... look at this link
  12. change coordinate system in object space

    Quote:Original post by Mussi This is hard to figure out, for every new snippet you post it seems there are new unknown variables. From what I can see in the video the matrix you draw your gizmos with seem to be correct right before you release the mouse button, that would mean that using the matrix you draw the gizmos with should be used to transform all your vertices once you release your mouse button. After transforming all your vertices the object matrix should be set to an identity matrix. mmm I don't understand why you say me that object matrix should be set to identity. I set to Identity trackball matrix after every time release the mouse button beacuse I would every time apply a new relative trasformation to vertex data. say me if the idea is right: I have a mesh object defined in object space and the object space axis have the same orientation of word axis. object space is position at (5,3,0) and have orientation (1,0,0) (0,1,0) (0,0,1). mesh->Tr in this case is 1005 0103 0010 0001 so to draw the object I do: glPushMatrix(); glMultMatrix(mesh->Tr); Draw(mesh); glPopMatrix(); I have a vertex defined as v1Obj=(x,y,z)=(3,2,0) respect to object space and v1Word=(8,5,0) respect to word space. now I translate the object space coordinate system about (-3,-1,0) and the vertex now is respect the new coordinate system and has value v1Obj=(6,3,0) and respect to word space axis v1Word=(8,5,0) I build a matrix inverse of (-3,-1,0) transformation and multiply the vertex for it 1003 3 6 0101 * 2 = 3 0010 0 0 0001 1 1 in my code is: vcg::tri::UpdatePosition<CMeshO>::Matrix(*c_mesh,m_inv); now I need to recalculate matrix Tr to draw the object in word space I multiply mesh->Tr for the new matrix that is the traslation about (-3,-1,0) 1005 100-3 1002 0103 * 010-1 = 0102 0010 001 0 0010 0001 000 1 0001 in my code: c_mesh->Tr=oldTr*trackball_slice.track.Matrix(); I get the newTr matrix 1002 0102 0010 0001 and now I draw the object with the newTr and with updated vertex 1002 6 8 0102 * 3 = 5 0010 0 0 0001 1 1
  13. change coordinate system in object space

    the function update vertex data: every vertex is multiply for the matrix m_inv and the result is assign to vertex itself. vcg::tri::UpdatePosition<CMeshO>::Matrix(*c_mesh,m_inv); void paintGL() { glClearColor(1.0,1.0,1.0,0.0); //vannini: alpha was 1.0 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); // Finally apply the Trackball for the model trackball.GetView(); trackball.Apply(false); glPushMatrix(); // every model is rendered foreach(MeshModel * mp, meshDoc.meshList) { // render and use glMultMatrix(cm.Tr) to do it... mp->Render(rm.drawMode,rm.colorMode,rm.textureMode); } // current mesh selected by plugin to change axis coordinate system... if(iEdit) iEdit->Decorate(meshDoc,this); .... } } bool Render(vcg::GLW::DrawMode _dm, vcg::GLW::ColorMode _cm, vcg::GLW::TextureMode _tm) { using namespace vcg; glPushMatrix(); glMultMatrix(cm.Tr); if( (_cm == GLW::CMPerFace) && (!tri::HasPerFaceColor(cm)) ) _cm=GLW::CMNone; if( (_tm == GLW::TMPerWedge )&& (!tri::HasPerWedgeTexCoord(cm)) ) _tm=GLW::TMNone; if( (_tm == GLW::TMPerWedgeMulti )&& (!tri::HasPerWedgeTexCoord(cm)) ) _tm=GLW::TMNone; glw.Draw(_dm,_cm,_tm); glPopMatrix(); return true; } Quote: So you want to change the vertex data with some matrix transformations without seeing change once rendered? Judging from your video you seem to have accomplished this, but the changes don't seem to be correct or the axis being displayed aren't. yes I would get it. I would like change the coordinate axis but the render and the world position about vertex data mush be the same.
  14. change coordinate system in object space

    the function update vertex data: every vertex is multiply for the matrix m_inv and the result is assign to vertex itself. vcg::tri::UpdatePosition<CMeshO>::Matrix(*c_mesh,m_inv); void paintGL() { glClearColor(1.0,1.0,1.0,0.0); //vannini: alpha was 1.0 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); // Finally apply the Trackball for the model trackball.GetView(); trackball.Apply(false); glPushMatrix(); // every model is rendered foreach(MeshModel * mp, meshDoc.meshList) { // render and use glMultMatrix(cm.Tr) to do it... mp->Render(rm.drawMode,rm.colorMode,rm.textureMode); } // current mesh selected by plugin to change axis coordinate system... if(iEdit) iEdit->Decorate(meshDoc,this); .... } } bool Render(vcg::GLW::DrawMode _dm, vcg::GLW::ColorMode _cm, vcg::GLW::TextureMode _tm) { using namespace vcg; glPushMatrix(); glMultMatrix(cm.Tr); if( (_cm == GLW::CMPerFace) && (!tri::HasPerFaceColor(cm)) ) _cm=GLW::CMNone; if( (_tm == GLW::TMPerWedge )&& (!tri::HasPerWedgeTexCoord(cm)) ) _tm=GLW::TMNone; if( (_tm == GLW::TMPerWedgeMulti )&& (!tri::HasPerWedgeTexCoord(cm)) ) _tm=GLW::TMNone; glw.Draw(_dm,_cm,_tm); glPopMatrix(); return true; } Quote: So you want to change the vertex data with some matrix transformations without seeing change once rendered? Judging from your video you seem to have accomplished this, but the changes don't seem to be correct or the axis being displayed aren't. yes I would get it. I would like change the coordinate axis but the render and the world position about vertex data mush be the same.