BTW, here's the link to Kwok's "Key rotate" plug-in:
http://forums.sketchucation.com/viewtopic.php?t=28086
Thanks for the pointers so far Kwok!
Woz
BTW, here's the link to Kwok's "Key rotate" plug-in:
http://forums.sketchucation.com/viewtopic.php?t=28086
Thanks for the pointers so far Kwok!
Woz
...ooh, forgot to mention...
I've set the Component Axis for each part to the same arbitrary point in space. made a little "gyroscope" looking thingy at the center of the shells to line up all of their centers with.
Woz.
Hi Tig,
have been looking at Kwok's "Key rotate" plug-in.
(and he's nicely tolerated my naivety in Ruby...)
It certainly looks like the most promising place to start.
Just hover my cursor over each component, then rotate each axis with the L-R/Up-down arrows etc.
Have so far managed to change it so that I get my desired 2 to 5 degrees component rotation per click.
The trick now is how to tell it to rotate each component around the assigned component axis instead of the general center of the component.
I'm now slowly wading through everything on Ruby online, dusting off my poor brain's cobwebs (being a Film SFX designer for 30 years, I left the computer biz way back when we hand-made things with Z80's!).
looking at this bit at the moment:
pt = e.bounds.center
Assuming this is the critical bit, I've yet to find out how to change it to refer it to the component's assigned axis instead.
Any help would be mega-fantastic. But this is a great learning experience at any rate.Cheers again,
Woz
@tig said:
As you want the globe to be invisible it could be difficult.
An instance could be give an anchor-point [the globe's center] and a radius.
Then whenever that type of attributed instance is selected the selection observer checks its location relative to the anchor and if the distance is not the radius it transforms the instance until it is, the vector for the translation transformation is easily got from the instances location and the anchor, adjusted so its length = radius...
Now we have an instance that is always 'radius' away from 'anchor'.
To ensure that it faces anchor properly as it is moved we also need to transform the instance about its z_axis so it matches the anchor>>>instance vector...
To ensure that the instance is correctly rotated around this anchor>>>instance vector we'd need something to establish that - probably something that uses the sphere's axis to ensure the instance doesn't get hopelessly spun around as we go...
So... it's not impossible then... just very awkward!!
Well, I'm STILL wading through the link you pointed me to.
...but I think I'm still a VERY long way in my learning enough to see clearlywhat's going on in all of your script.
So... as is, does your script transform the active entities (group, component) around their arbitrary geometric central axis?
I'm trying to see which part of the script works that particular bit out.
I would imagine my next step is to find out how to point your script to something that would describe the active entity's "COMPONENT AXIS" in each case.
In my ultimate desired use, all of the component axis's would also fall on the same real-world axis for each piece. If you could imagine each component looks a bit like a floating piece of a "cracked-apart spherical "shell" each rotating about a common "core" but each on slightly different layers so that they can "sheer" over each other.
As you might visualize, ultimately, it would be like pushing and rotating continents around on the surface of a little globe of the earth in any direction, each continent always properly oriented to the Core, and appearing to "float" with respect to the surface and each other.
With your script, I've managed now to at least get each component to rotate by 2 degree increments for each keystroke, but of course they just rotate where they are, intersecting each other.
Lots of working out ahead.
Thanks again Kwok,
Cheers,
Woz
@kyyu said:
The variable "v" specifies the vector, representing the rotation axis. For example, for the Z axis: "v = Geom::Vector3d.new(0,0,1)"
Oh, I guess you need the rotation point, also.
It's these two lines of code that does the rotation:
tr = Geom::Transformation.rotation(pt,v,angle.degrees)
Sketchup.active_model.active_entities.transform_entities(tr,e)Study the Sketchup Ruby API. For example, for the 1st line: http://code.google.com/apis/sketchup/docs/ourdoc/transformation.html#rotation
-Kwok
@kyyu said:
The variable "v" specifies the vector, representing the rotation axis. For example, for the Z axis: "v = Geom::Vector3d.new(0,0,1)"
DANG!
....I'm going to have to REALLYswat up now and see if I can get to a stage where I can fully understand your answer (only JUST getting into the bare rudiments of scripting over these last few weeks).
So... you're meaning I have to find a way of relating to the relevant axis that has already been Assignedto each selected component?
...LOTS of leaning ahead 4 me m'thinks...
Thanks kyyu.
Woz
Hi,
after checking your Key rotate out, it's ALMOST the perfect thing I need for a problem I'm working on.
I've been able to get it to rotate all the way down to 1 degree increments per axis - which is part 1 of what I need - but does Anyone know what would need to be modified to make each component rotate on it's COMPONENT axis?
Fingers crossed,
cheers,
Woz.
@unknownuser said:
here's a roughed out dynamic component..
[attachment=0:coswjkjp]<!-- ia0 -->globe_plates.skp<!-- ia0 -->[/attachment:coswjkjp]
this one just has random degress between -90,90 on the x and z axis..
it's messed up somewhere as one of the axis snaps back to the original position after the animation.
I'm only now just beginning to look at dynamic components. Trying to adjust the parameters of your model:
ANIMATE("rotx", RANDBETWEEN(-90,90)); ANIMATE("rotz", RANDBETWEEN(-90,90))
and have so far managed only to reduce the degrees that it ranomly moves the comonents by. Trying anything else with the expressions just has it doing a syntax error.
Would love to at least learn how to get your plates to just move 1 set number of degrees increment with each click, THEN find how to tell it which direction 9+ or -) to go, with perhaps a keystroke. Then maybe work out some combination to tell them either +x, -x, +y,-Y, per click...
Can't find any "easy-to-understand" info on how do do much with 'Rotx", Rotz" , etc, online though.
Anyone have suggestions?
I think he simply finds the whole "Bug Splat" thing (as of course EVERYONE must too) plain annoying.
I generally switch off autosave (so It doesn't freeze everything for 5 seconds every 5 mins or so justwhen your're concentrating on some fiddly important bit), and just remember to save after each bit is conquered.
Psychologically, the sudden (and often repeated) apperance of Sketchup's "Bugsplat" message makes one generally more furious the more important the bit is that you're working on when it happens!
...Like when you've spent what seems like an ageselecting a bazillion edges & surfaces, getting them ready to carefully intersect with each other, when, BANG! the irreverent "BugSplat" messsage appears, and you find yourself having to go to the store and buy a new (and hopefully sturdier) monitor to replace the one that you've now thrown out your office window into traffic.
...maybe in some long-distant day, there'll be no more bug-splats... just like one day Windows users won't need Ctrl/alt/del.
...one day... (sigh...).
WOW!
Thanks Jeff!
I think, using the line you're going down, the interact tool might be set for just a pre-set number of degrees "plate" rotation per click (say, 2 degrees or so). The trick would be - and I'm not yet familiar with dynamic components, or scripting yet to know if this is possible - holding down another key (say, one of the Left/Right, or Up/Down keys) to decide which on axis, and direction, the touched plate will move. Maybe holding another key (maybe the left "[" and right "]" keys) would cause the plate to rotate (2 degrees or so, again) in it's relative z axis to where it's sitting.
I think this might streamline things enormously... if possible.
Hmmm...
I'm getting excited now!
all the possibilities!
Thanks Tig,
will investigate it & get back.
...is that a Thylacine? ...helped make an animatronic one years ago for a Cascade Lager Commercial in Oz.
Yep! just like that... except imagine you have about a dozen pieces, capable of being moved about on the surface of the sphere - on 3 tiered levels above the sperical base surface - in both the X, Y axis. and rotated about on the Y, relative to wherever they are on the surface.
we're talking in small increments too. Between just 1 to 12 degrees at a time. Doing it 1 axis at a time - as you've kindly illustrated - is possible, but becomes tedious when each of 12 pieces x 3 moves x about 40 or so different combinations of relative positions... that's near 1500 stages in the end.
In the end, I imagined there must be a way to use something like the dynamic tools "grab hand" to touch then grab each component, having them each "rigged" to slide about the core of the sphere following the surface in the x-y & z... somehow.
Cheers,
Woz
Thanks Gaieus,
I'll see if I can put together some screen-grabs to illustrate what I'm up to.
Can't post the actual shapes, as it's for a client - IP issues, etc...
Again, Imagine you have a "globe-of-the-world"model - pretty smooth - and have little "plates"on the surface, like continents, and you want to move these bits about the central axis - somewhat like continental drift - "floating"on the sphere's surface...
Hi again,
I'm creating a model which contains a dozen or so components which can best be described as irregular shaped segments cut from spherical shells of cascading sizes. There's about 3 "floating" layers around a static shallow base dome.
I've yet to find a way of "floating" these pieces about the "parent" dome (all have the same xyz axis) sort of like you might imagine "floating" continents around a globe of the earth by nudging them bit-by-bit with your finger.
I imagine I need to somehow "hinge" each of these segments to a common xyz axis. But it's somewhat tedious to have to select each bit, then rotate it a little about central X, then rotate a little about central Y. plus even skewing these pieces about z in respect to the spherical surface seems a daunting task in itself...
I'm also trying to get my head about "dynamic components" but I as I see it, the best I might manage is a single axis rotate - for a fixed ammount of degrees - on "click".
Any suggestions - no matter how crazy - will be appreciated.
Cheers,
Woz
Thank you, Thank you, Thank you, Thank you, Thank you, Thank you!!!
Hopefully... this'll solve my woes.
Cheers Honoluludesktop,
Woz
Hi,
Has anyone worked out how to - or created a plug-in for - accurate control of the "Sun's" position relative to your scene, overriding the whole "time-of-day, time-of-year" thing?
I've searched this forum, and can find no leads so far. There no doubt HAS to be a simple way someone has kindly worked out?
99 percent of the time I need to get the light "just so" in relation to my models, and can never get it quite there with Sketchup's native Sun controls.
I use twilight for my finished renders.
I'm fairly new to this forum, but used Sketchup for about 3 years so far. Can't wait to share any things I discover with all here.
Thanks,
Woz.
HOOLLLD EV'RYTHING!!!
After nuch banging-of-head-on-desk... and experiments... I tried Frederik's suggestion. No dice. But did the same and made into a COMPONENT... all solved! ...for now. Though I'm still fuzzy as to why this should actually work. But. Don't question miracles (well, not DIGITAL ones, anyway).
Busy now doing jolly fantastic things with it.
I is now in heaven!
I think by FAR the Artisan will turn out to be the best thing to happen to sketchup to date.
Cheers all,
Woz