Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Mesh Editing using javascript

Raghini_Jaiswal
Guest
Quote
2017-10-15 17:59:38

Are there any examples for Javascript Api for Mesh Edtitng.
I have gone through the Documentation but didn't found anything.
There is no proper examples.
one can not simply understand the api without examples.

i was posting this for help but i have to mention that the documentation isn't good enough to impress developers outside this community.

It seems that the developer of coppercube was too lazy that he missed the whole mesh editing thing in javascript Api.
He was so lazy to provide a single example for the mesh editing.
The Documentation needs to be updated.

and Javascript API needs to be extended.

Hope Ambiera's developer will work on it.

meanwhile if anybody can help me with the mesh editing options. All of your help will be appreciated.


niko
Moderator
Quote
2017-10-16 11:20:33

See the documentation, there are actually two examples there. For modifying a 3D mesh, use for example this:

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)
{
var vertexcount = ccbGetMeshBufferVertexCount(meshnode, i);
for (var v=0; v<vertexcount; ++v)
{
var pos = ccbGetMeshBufferVertexPosition(meshnode, i, v);

pos.x *= 2;
pos.y *= 2;
pos.z *= 2;

ccbSetMeshBufferVertexPosition(meshnode, i, v, pos);
}
}
ccbUpdateSceneNodeBoundingBox(meshnode);
}


Run this in the editor, you can even directly run this from the JavaScript code window.


Raghini_Jaiswal
Guest
Quote
2017-10-17 06:44:15

Yeah there are some examples.

But not all of the tools have examples.

for example i want to create a new mesh by selecting triangles and then change their UV textures.

that can help in creating decals. i was wondering if you can do this. just select 2 triangles using select rect and then create a new mesh node using the selected triangles. then change their UV textures to transparent Alpha using a custom texture.

now it will look as if it was a decal. Only transparent textures can be used as decals. and i know very well that this will not work for target other than Windows or Mac

but that can be possible.

if you can't do this.
then please provide examples for each topic of mesh editing so i can understand it better and Develop it myself.


niko
Moderator
Quote
2017-10-17 11:44:13

This tutorial here might also help you getting an overview on how it works: http://www.ambiera.com/coppercub...

Maybe it helps?


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact