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: 

Getting world matrix from bifrost fluids cache or alembic mesh

6 REPLIES 6
Reply
Message 1 of 7
teddude75
600 Views, 6 Replies

Getting world matrix from bifrost fluids cache or alembic mesh

I was wondering if there is a way to get the matrix position of Bifrost fluids from cache or alembic. I can get point position from mesh but how do I turn that into matrix position?  Also the cache has particle position how do I get the matrix position out of that?

6 REPLIES 6
Message 2 of 7
syracoj
in reply to: teddude75

Using a basic_particle system I believe an example of this type of data retrieval can be done using get_geo_properties that are then plugged into an SRT_to_matrix compound.

 

see image:

 

getMatrixFromPartSys.png

Message 3 of 7
syracoj
in reply to: teddude75

will see what kind of data can be 'get' on an alembic cache. In cases such as these, watchpoints are your friend to see what data is available on an object.

Message 4 of 7
syracoj
in reply to: teddude75

if I export out an alembic file from Maya of a simple object whose xforms are animated, when I read it back in using the read_Alembic node the only meaningful transform I can retrieve is the point_positions of the alembic file. Therefore, there isn't an easy way to get matrix data out of it because we don't have enough xform data.

 

The bifrost particle system example I posted earlier is different because we can turn on features of it that include the additional xform data.

 

Apologies if this isn't useful.

Message 5 of 7
teddude75
in reply to: syracoj

Isn't point position the same as world matrix? Isn't point position calculating the vertex position of a mesh?

Message 6 of 7
teddude75
in reply to: teddude75

I have a basic water simulation and I want to create wet maps for the water. I found a shader that applies a mask on a surface using world matrix and it works with a basic cube. Is there any thoughts on wet maps?

Message 7 of 7
syracoj
in reply to: teddude75

That may work if you use get_point_position and plug that into the translate port of the SRT_to_matrix node.

 

Usually (AFAIK), matrix is used to hold the complete xform package (translation, scale, and rotation)

If you connect a sphere or torus's transform node .translate channel to a float3 bifrostGraph input, and feed this to the SRT_to_matrix.translation port, and then move, scale, and rotate the torus, you will see that only the translation causes any update in the matrix data table. You wont see any added xform in the matrix table for scale and rotate until those are connected in to the SRT_to_matrix quaternion and scale ports.

 

If you connect the sphere or torus object into the bifostGraph as an object, then feed it into a get_point_position node, and then feed the get_point_position into the SRT_to_matrix and you move, rotate, and scale the object, then all three xforms will update the translation portion (c3.x,y,z) of the matrix table. Thus why it may work in your particular case.

 

Typically though the data for each xform is contained in its own corresponding row/column of the 4x4 matrix separately.

 

Best thing to do is just try it (the shader approach to wet map). The matrix data coming out should be digestible by other DG level items outside the board. 

 

NOTE: If you set a watchpoint inside the bifrostGraph on a connection wire such as a float4x4 matrix wire, you may need to add a value node to a port on the output node (set to data type: object) to get the graph to properly evaluate and update with a meaningful display of the watchpoint data. We have room for improvements regarding this.

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

Post to forums