 Guest Guest |
Quote
|
2022-07-22 06:09:20 |
|
I just figured out that it easier to control a character animation when you make it a child of an invisible node instead of directly control it. By this way, you are free to play many animation as you want when you move the character (like crouching).
Also I think coppercube should have a no-mesh node??
|
 just_in_case Moderator |
Quote
|
2022-07-22 06:36:21 |
|
Yeah, that's how I do it most of the time with animated characters, You can have a loot at my Beat'em up demo, it uses the same technique, you can create a noo-mesh node, by simply creating a cube with 0 size or create a sphere with 0 radius and 0 poly count, it will give you an empty node or a node with no mesh.
The term invisible will be wrong, you should say transparent here because making the node invisible will also make its children invisible. it's better if you use an empty node, as it will not do any render calls for texture and there will be no extra polygons in your scene.
|
 Guest Guest |
Quote
|
2022-07-22 07:51:04 |
|
Thank, I don't know you could turn a mesh to 0 size!
|
 Guest Guest |
Quote
|
2022-07-23 21:56:06 |
|
Use this code in the editor's scripting window to get a proper empty node. No polygons. Handy for changing origin points of models (like door rotation points) and storing textures for later use. The way Just_In_Case mentions will have polygons involved. If you split the mesh for lighting purposes, it will then split those polys as well. This way that won't happen because this has no polys to select.
var meshnode = editorGetSelectedSceneNode(); var bufferCount = ccbGetSceneNodeMeshBufferCount(meshnode);
if (bufferCount == 0) alert('The selected node has no 3D geometry.'); else { for (var i=0; i<bufferCount; ++i) ccbRemoveMeshBuffer(meshnode, 0); ccbAddMeshBuffer(meshnode); ccbAddMeshBufferVertex(meshnode, 0, new vector3d(0,0,0)); ccbUpdateSceneNodeBoundingBox(meshnode); }
Make sure you have the mesh you want to change selected before executing the code. I recommend saving the modified mesh as a prefab afterward so you don't have to run it again and again.
|