article thumbnail

Get node's 3d-mesh size?

Cocos

That’s the code I need! For others to get node’s mesh size function getNodeMeshSize(node) { const halfExtents = node.getComponent(MeshRenderer).model.modelBounds.halfExtents; Thanks so much! model.modelBounds.halfExtents; return halfExtents.clone().multiplyScalar(2); multiplyScalar(2); }

Mesh 40
article thumbnail

How to color triangels in custom Mesh?

Cocos

seems does’t work, my sample code below. colors.push( color ); colors.push( color); colors.push( color); } let mesh = cc.utils.createMesh({ positions : positions, indices : indices, doubleSided : true, colors: colors}); let comp = node.addComponent(cc.MeshRenderer); comp.mesh = mesh; positions[i + 1] = pos.y;

Mesh 40
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Developer Shares Building Fabrics, Ropes, And Soft Bodies

Cocos

or better : with 3D scenes Origins Two days ago, I saw a fun effect: The article was: Dazzling HTML5 Front End Design Source Code Analysis Notes - Remnant Clothes Effect Example: Tearable Grid It is an effect that I’ve seen before and recently brushed up on. So I researched the code and prepared to port it to Cocos.

Build 98
article thumbnail

Changing vertexData of a sprite in 2D in cocos creator 3.6.2

Cocos

by converting code from graphics-assembler from CC2.4 but facing one issue depending on the sprite type mesh which is in CC2.4 Hello @zhangxm , I was able to modify the vertex data in CC3.6 where there is a function to create render data renderData.createFlexData but I could not find any way to do it in CC3.6. Since in CC3.6

Sprite 40
article thumbnail

[Tutorial]Make the game run smoothly on high-end, mid-range, and low-end devices - Guide to Cocos Cyberpunk Source Code

Cocos

This series of articles will analyze the source code from various perspectives to improve your learning efficiency. Download the project source code for free at: [link] Preface As one of the core skills of a lead programmer in large projects, I recommend those who have not yet mastered it to catch up quickly.

Code 52
article thumbnail

Godot Tactics RPG – 01. Intro & Setup

The Liquid Fire

link] [link] [link] [link] [link] Prerequisites Some knowledge of code is definitely going to help here. I’ll be writing most code in Godot’s Gdscript, so familiarity with that or Python will help. Type in mesh in the search and select MeshInstance3D. Search for mesh and again choose MeshInstance3D.

article thumbnail

Recreate High-Fidelity Digital Twins with Neural Kernel Surface Reconstruction

Nvidia

Reconstructed geometry on Waymo Open Dataset The kitchen sink model Alongside the code release, we are excited to introduce the kitchen sink model, a comprehensive model trained on datasets of varying scales. mesh = field.extract_dual_mesh(mise_iter=2) # Visualizing from pycg import vis vis.show_3d([vis.mesh(mesh.v,

Mesh 52