Showing posts with label camera. Show all posts
Showing posts with label camera. Show all posts

Thursday 11 April 2024

culling stuff camera

 string camera=chs("../camera");

vector campos=toNDC(camera,@P);



vector2 padding =chu("../padding");


if((campos.x+padding.x)<0||(campos.x-padding.x)>1||(campos.y+padding.y)||(campos.y-padding.y)){

        i@group_kill=1;}


matrix cam=optransform(camera);


vector camera_position=cracktransform(0,0,0,{0,0,0}, cam);


float distance =distance (camera_position,@P);


float threshold=chf("../distance");

if(distance>threshold){

        i@group_kill=1;}

Thursday 22 September 2022

camera projection uv, texture reference object a la Maya

A simple thing..

In Maya, you can project UVs from a camera. To prevent textures from swimming if you do animate the object, you must create a Texture Reference Object. Here's how you do it in Houdini.

The gist is - 

  • use the UVTEXTURE node to project your uv's. Set the texture type to Perspective from Camera and specify the projection camera in the appropriate box.
  • freeze the object on the frame you want the projection to occur at, using a TIMESHIFT.
  • copy the uv attribute back onto the moving object, using the ATTRIBUTE COPY node.

Thursday 1 April 2021

attaching nulls to parts of a moving/deforming object. rivet.

At SOP level, select 3 points of the geo you need to attach a rivet to, this is to calculate rotation (if your object/mesh-area is rotating/deforming)

Make a group with these points, call it something like "pivot_group".

 Go up to Object Level and make a Rivet node.
Here, specify the SOP eg - /obj/geo1/object_merge1

and the pivot_group in the Point Group dialog box.


You can now parent a NULL or something else to the rivet. Something I noticed, was the rotation of the null can be a bit offset, and I've been manually adjusting the rotation...

If you're exporting a null for Flame, you might be better off parenting a camera object, as the alembic export seems to ignore the null. Maya will import a null, although it will show up as an invisible point, so again you're probably better off using a camera for this too.

I've been exporting the null using the File-Export-Alembic tool..

Wednesday 30 October 2019

camera projection with houdini

Houdini camera projection is as simple as creating a "UV TEXTURE" node and plugging it into the geo you're projecting onto.
In this node, select "Perspective from Camera", from the Texture Type dropdown menu.
You could name the UV Attribute something other than the default of "uv" if you are creating some alternate uv sets.
In the Camera dialog box, specify the camera node. Eg. /obj/cam1 & usually the attribute class for the uv's will be set to vertex.

Now, whatever material you apply to it will use these uv's. (or maybe a different set if you specify within the shader network!) eg. uv2.

Friday 29 March 2019

2d zoom pan

ctrl alt rmb drag..
if there's an image plane, lock the camera movement

Thursday 6 October 2016

Importing an Alembic Camera from Maya

Create an alembic archive and bring the .abc file in that way.
If you need to scale it to account for Maya's scene scale, make a Null node, scale it as you will & plug the Alembic Archive beneath it.
If you mess about with any frame-time-offsets, be sure to click the Push Parameters to Children button.