Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do you construct a mesh from scratch?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
muream
750 Views, 2 Replies

How do you construct a mesh from scratch?

Hey!
I'm making a Pose Reader component and wanted to draw a cone to visualize the component's behavior properly.
I currently have all the cone vertices in an array, using the construct_mesh node I can show all the points but I can't figure out how to create the actual faces between those points. I bet this is with the face_offset and face_vertex ports but I don't understand how to use them and couldn't find any documentation on that.

Here's a quick video of it in action (the points are connected with a construct_strands node for now)
https://streamable.com/hjw31


I attached the component in its current state. I should have removed any local dependency but if there are any that cause an issue, just tell me and I'll fix that.

Thanks!

2 REPLIES 2
Message 2 of 3
muream
in reply to: muream

I figured it out by going through the different compounds that did that and made a little tutorial on how the construct_mesh node worked. Hopefully it's useful to someone 🙂
https://vimeo.com/358591935

Message 3 of 3
stephen.yee
in reply to: muream

Great video, thanks for making it Loic!

 

Just wanted to give you a heads up, there is some documentation that describes how the face_offset and face_vertex arrays work. Its a bit buried in the installation directory though. Its located at <bifrost_plugin_install_dir>\plug-ins\bifrost\resources\bif\jsonLibs\doc\getting_started\geometry_basics.md

 

Also, one thing to note (that I will add to the above docs) is that the ordering of the face_vertex elements controls which side of the face is considered the "front". i.e. the direction that the normal points. We use counter-clockwise ordering in Bifrost, which means that if you look at a face head-on, and specify the vertices in a counter-clockwise order, the face will point towards you.

 

twoTriangles.png

In the above example, if we specify the face_vertex array as  0,1,2, 1,3,2  it means the two triangles would point towards us. 

 

If we specified the face_vertex array as: 0,2,1, 3,2,1 then the two triangles would point away from us, into the screen. 

 

For a cube, you usually want the faces pointing towards the outside, i.e. away from the center of the cube. So in your example in the video, the face vertices for that second face should be 4,7,6,5 i.e. downwards. I think that's why the normals come out looking odd. 

 

One easy way to remember this is if you curl the fingers of your right hand in the direction of the face vertices, in the order you specify, then your right thumb will point in the direction of the face normal. 

 

Hopefully that makes sense!

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report