zasid Posted March 30, 2008 Share Posted March 30, 2008 Hi, How can I flip each face of the BOX or GRID one by one to create an effect. 1) TOP side of the BOX or GRID there is one texture 2) BOTTOM side of the BOX or GRID has another texture. 3) I want the faces of the box or grid to flip one by one to reveal the textured part underneath. it will be great if you can post an example hip file of the scene.So that I can understand you concept better. thanks Zasid. Quote Link to comment Share on other sites More sharing options...
petz Posted March 30, 2008 Share Posted March 30, 2008 file is attached! petz flip1.hipnc Quote Link to comment Share on other sites More sharing options...
zasid Posted March 30, 2008 Author Share Posted March 30, 2008 file is attached!petz Thank you very much Petz for sharing the file. Quote Link to comment Share on other sites More sharing options...
zasid Posted March 30, 2008 Author Share Posted March 30, 2008 Thank you very much Petz for sharing the file. Petz can you explain me why are you using the nodes SORT abd FOR EACH and what does this express means . int(fit($F, $FSTART, $FEND, 0, nprims("../copy1"))) where did u declare these variables FSTART and FEND or are they the global variables like $F. I tried to look for the foreach value in the help file but didn't get much from it . Thanks. Quote Link to comment Share on other sites More sharing options...
Netvudu Posted April 1, 2008 Share Posted April 1, 2008 (edited) Personally I could also take an explanation on the use of the FOR EACH node. I didn Edited April 1, 2008 by Netvudu Quote Link to comment Share on other sites More sharing options...
zasid Posted April 1, 2008 Author Share Posted April 1, 2008 Hello Thanks for the response I think FOR EACH fuction seems to be some kind of recursive function that calls individual faces of grid and flip it over but how it is doing it is still not clear to me plus I can't see any animation channel its just one xform getting flip at an angle of 90 in x. Quote Link to comment Share on other sites More sharing options...
rdg Posted April 1, 2008 Share Posted April 1, 2008 the foreachSOP might be getting slow on larger geometries. I often use this setup for such tasks. Use a facetSOP to break the geometry into unique primitives. Then modify each primitve with the primitiveSOP. The expression clamp(-$PR + $NPR * ch("flip"), 0, 1) returns a 0 to 1 value for each primitive. flip is a sapre channel that is used to animate the flipping progress. flipfunc is the sparechannel that holds the function - this is only for design purpose - for more speed skip this and pull the expression directly into the parameter. A twosided shader is attached to color front and back differently. rdg_flipemall.hipnc Maybe there is a way to preview two-sided shaders in the viewport, but I am not aware of it. So the final result is only visible after rendering. Reading the posts on the SESIlist about pro/con of pointSOP expressions vs VEX - it might be faster to pull this into vex. But to be honest: rotationMatrix and me were never good friends. Georg Quote Link to comment Share on other sites More sharing options...
petz Posted April 1, 2008 Share Posted April 1, 2008 sorry for the late reply but i was a bit busy last day. altougth georgs setup is much more smarter then mine i Quote Link to comment Share on other sites More sharing options...
zasid Posted April 1, 2008 Author Share Posted April 1, 2008 sorry for the late reply but i was a bit busy last day. altougth georgs setup is much more smarter then mine i Quote Link to comment Share on other sites More sharing options...
rdg Posted April 1, 2008 Share Posted April 1, 2008 NEVER THINK TO COMPLICATED! That's right and the main reason I posted this approach is: I often get smarter files from petz for stuff I spent hours to overcomplexify. On the other hand: The 'smartness' of this particular setup took me almost a year. Since I started learning houdini I work on the 'generic function for growth'. I use(d) copystamp deletes, chops, groups, expressions of the size of 'single-family detached houses' and monolithic combinations of those - until I it showed that this is the function I was looking for all the time. Georg Quote Link to comment Share on other sites More sharing options...
zasid Posted April 1, 2008 Author Share Posted April 1, 2008 Hi there , I tired and play around with the file but when I try to plugin more complex geometry such as torus or any poly edited geo ,face rotation doesn't seems to work The key point I see in this problem is that I need to rotate every face along its normal so that the rotation should look correct but I really don't know how to do it . Please have a look at the file attached. thank you very much. rdg_flipemall_problem.hipnc Quote Link to comment Share on other sites More sharing options...
rdg Posted April 1, 2008 Share Posted April 1, 2008 (edited) The key point I see in this problem is that I need to rotate every face along its normal so that the rotation should look correct but I really don't know how to do it . The normal is the vector that is perpendicular to the face, I don't think you want to rotate about this. You are looking for a vector that is perpendicular to the normal. you can find such vector with the cross product of the normal and a second vector constructed from point of the face. I guess it's rather hard to find a generic way to calculate such vector - at least for me. I stumbled over this a lot of times. In my example the face rotates about the X axis no matter what. that's why the 'problem' appears. There is a posting somewhere in this forum where it is explained how to construct a vopSOP that reorientates arbitrary faces to the world XYZ to align it to another face. This might help. If this is too complicated, then you can find maybe a way to re-construct your geometry so all faces can rotate about X anytime. Edited April 1, 2008 by rdg Quote Link to comment Share on other sites More sharing options...
petz Posted April 1, 2008 Share Posted April 1, 2008 sometimes its handy to use the polyextrude-sop for things like that. so you might be able to rotate about the local axis of the prims. just use output front alone inside options. if didn Quote Link to comment Share on other sites More sharing options...
zasid Posted April 2, 2008 Author Share Posted April 2, 2008 Thanks Petz I will try that Quote Link to comment Share on other sites More sharing options...
rdg Posted April 2, 2008 Share Posted April 2, 2008 sometimes its handy to use the polyextrude-sop for things like that. can you explain this? wouldn't this result in a myriad of polyextrudes? as for the rhombic shapes: you would need to convert the space of the face to something usable - like in shader spaces. so pick a face (like foreach or copy/delete), align it to worldspace and place it at [0, 0, 0], do your rotations, push it back to were it belongs to, fin. I believe that a simple crossproduct of the primitive normal and a world axis like [1, 0, 0] should give you the angles need. Assuming that the face/primitive is planar. Quote Link to comment Share on other sites More sharing options...
petz Posted April 2, 2008 Share Posted April 2, 2008 file is attached. petz local_rotation1.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.