≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Draw Line - 3d
Posted by:
(you are not logged in)
Enter the missing letter in: "Internatio?al"
(you are not logged in)
Text:
[quote][b][/b] wrote: @carlosmbr here is the code to create a line in the editor there Coppercube but you do very little with it because it is invisible in the 'editor if it is not selected you can use it as a collider , in the game it is invisible. [code]var meshnode = editorGetSelectedSceneNode(); var bufferCount = ccbGetSceneNodeMeshBufferCount(meshnode); if (bufferCount == 0) alert('The selected node has no 3D geometry.'); else { // remove all mesh buffers holding geometry, //because we want to replace its geometry with a totally new one for (var i=0; i<bufferCount; ++i) ccbRemoveMeshBuffer(meshnode, 0); // add new buffer ccbAddMeshBuffer(meshnode); // disable dynamic lighting ccbSetSceneNodeMaterialProperty(meshnode, 0, 'Lighting', false); // add 5 vertices ccbAddMeshBufferVertex(meshnode, 0, new vector3d(0,0,0)); ccbAddMeshBufferVertex(meshnode, 0, new vector3d(40,0,0)); // set their colors ccbSetMeshBufferVertexColor(meshnode, 0, 0, 0x77400000); ccbSetMeshBufferVertexColor(meshnode, 0, 1, 0x77400000); // add indices for (var i = 0; i < 4; i++) { ccbAddMeshBufferIndex(meshnode, 0, i); ccbAddMeshBufferIndex(meshnode, 0, i + 1); } // update the bounding box of the node ccbUpdateSceneNodeBoundingBox(meshnode); }[/code][/quote]
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