Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 ] Page 1 of 2 |
|
|||||
|
Hi everyone, Just trying out the demo of CC. I come from working on a C-sharp project where I built and animated a head. I animated using my own morph target animation. My question is this : can I take a mesh and iterate over it changing it's shape per vertex ? Is there possibly some one who could show me in code an example of doing this ? I see when I import an OBJ model that the groups seemed to get merged into one mesh - is that correct ? Can the grouping be retained so I have a model made of it's groups, ie individual meshes of the groups ? If not I figured I could import the groups individually and animate them separately... but 'join' them somehow. The reason is that for efficiency I would only want to animate parts of the whole model. Any thoughts ? Many thanks ! |
||||
|
Yes, you can do this using the Mesh Editing functions (see here: http://www.ambiera.com/coppercub...), like with this example for scaling all vertices by a factor 2: var meshnode = editorGetSelectedSceneNode(); But this only works in the editor and in the Windows .exe and Mac OS .exe targets. (For the last two, you need to adapt the example of course a bit, because the functions starting with editor won't exist there) About the groups when importing: Yes, that's how it works in coppercube. If you want multiple meshes, you need to import them from separate files. |
||||
|
Thanks for the quick reply. I was hoping to run this on the web using an HTML document. But from what you say that's not possible. That's a shame :( |
||||
|
Are there any plans to extend this to be included in the WebGL part ? |
||||
|
If you want to run this one the web with WebGL, this is also possible. You just need to use another API for it, there is something more powerful available for WebGL, named copperlicht, see here: http://www.ambiera.com/copperlic... |
||||
|
Ohh nice :) Thanks, I will take a look at the new goodies ![]() |
||||
|
Just one quick question... I was using morph targets in my C-sharp program. In other words I had differing models loaded into memory and used them as my reference points for the morphing. My question is, would I be able to load a mesh but not necessarily display it ? Can a mesh be in memory and not displayed without any overheads ? IF not, maybe I can write something to load the target morphs into some data structure. Thanks :) |
||||
|
Yes, that's no problem. In copperLicht, you can access your data through CL3D.Mesh and CL3D.MeshBuffer. Simply don't display it (make it invisible for example, or remove it from the scene) and no overhead will be done. |
||||
|
Hi Niko, Thanks for the information. I'll have a play with things this week hopefully. Thanks a lot for the replies you guys :) |
||||
|
I can't quite work this out. I'm trying to load a mesh into an array, so that I can traverse the array and work out how the main model should be morphed.... 'v3' is a model that is in memory but not visible - this is my morph target. This is my JS, the trouble is there does not seem to be anything in 'foo'. Could someone advise please ? var engine = startCopperLichtFromFile('3darea', 'copperlichtdata/anima.ccbjs', 'Loading $PROGRESS$...', 'Error: This browser does not support WebGL.'); |
||||
|
Above, Niko gave this example for CopperCube....
This is the kind of thing that I need to do. Is there possibly an example for CopperLicht ? I can't seem to find anything.. Cheers :) |
||||
|
Hi, you can use the CopperLicht API as well like this:
I just wrote this without testing it, but it should work. |
||||
|
Hey Nico, thanks a lot for you help. I tried this but Firefox is returning the error : TypeError: mesh.Vertices is undefined I'll see if I can find out why, unless you beat me to it ;) |
||||
|
Oh, it should have been 'meshBuffer', mistyped. I updated the code :) |
||||
|
Yeah that works ![]() Thank you ! |
[ 1 2 ] Page 1 of 2 |
|