Archived

This topic is now archived and is closed to further replies.

Lloyd Wright

Geomorhs in ROAM

Recommended Posts

Hi I''m currently implementing Geomorphs in ROAM. Has anyone done this....I''m having troubles with cracking :-( Each node in the Binary Trianlge Tree has an associated morph value ( between 0 and 1), but in some cases, cracks appear due to two nodes (that share a vertex) having different morph values. Any input would be greatly appreciated, as I''m gonna work on this until I get it sorted. thnx Lloyd

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just force the apex vertex of neighbouring nodes to have the same morph value.

If you are morphing based on time then since the vertices start at the same value and have the same finishing value, they should morph without cracks.

However cracks occured for me when i split nodes that are currently morphing - to solve this i force the morphing vertecies to its final height.

Here is the code:

/*
* If we are splitting a node that is still morphing,
* we need to set all the triangles that contain the morphing
* node to full height to prevent cracks. The nodes that need
* changing are the parents children and the parents baseneighbours
* children/.
*/
if(node->parent)
{
node->parent->leftChild->currentApexy = *node->parent->leftChild->targetApexyp;
node->parent->rightChild->currentApexy = *node->parent->rightChild->targetApexyp;

if(node->parent->baseNeighbour)
{
node->parent->baseNeighbour->leftChild->currentApexy = *node->parent->baseNeighbour->leftChild->targetApexyp;
node->parent->baseNeighbour->rightChild->currentApexy = *node->parent->baseNeighbour->rightChild->targetApexyp;
}
}


Instead of a 0 to 1 morph value i have a current Apex value and a pointer to the ''target'' value in the heightmap (which changes with explosions etc.) silly huh?

Hope that helps.

Share this post


Link to post
Share on other sites