View Full Version : Q:erm, I'm not sure what to call it...
The Commander 05-06-2003, 12:46 AM Hey guys, I was hoping to pick your brains, tallented as they are. A group of us at Uni have some crazy project to do, and we've run into 2 snags. I'll sperate them so as to make this easier...
Snag 1: imagine a sphere where a bulge appears and moves accross the surface. The Sphere is basic grey, but we want the bulge to be a different colour. however, the bulge is animated and moves across the surface. We were hoping it was possible to somehow make a textures visibility related to the distance the points/cvs are from the center of the sphere. Something like that. Any ideas?
|
|
The Commander
05-06-2003, 12:49 AM
Snag 2: Probably a lot easier to fix is this one. We have aan extrude moving along a path, but when it reaches a corner, it does this. Is there a way to make the extrude turn to face the direction the path travels in?
Thanks very much in advance!
gmask
05-06-2003, 01:43 AM
Originally posted by The Commander
We were hoping it was possible to somehow make a textures visibility related to the distance the points/cvs are from the center of the sphere. Something like that. Any ideas?
Hmm there may be a way to do that by using an expression to read the distance an then use a layered sahder that has a transparency map over the area that changes color.
Are you trying to make a bump liek somebody would get when bonked on the head or pimple? If so you could also just make an aniamted displacement map and an aniamted color map tog et similair results.. it really depends on how much control you need.
gmask
05-06-2003, 01:44 AM
Originally posted by The Commander
Snag 2: Probably a lot easier to fix is this one. We have aan extrude moving along a path, but when it reaches a corner, it does this. Is there a way to make the extrude turn to face the direction the path travels in?
You need to opent he options for the extrude command and choose the whole row of prefs on the right top half of the window.
ntmonkey
05-06-2003, 06:24 AM
For the extrude problem:
Surfaces > Extrude > [ ] (optionbox)
Change it from Flat to Tube.
augustus
05-06-2003, 06:47 AM
For 1st question. Yes, there is a node called Distance Between (or something like that, i don't have documents here). You can create this node with createNode command:
createNode distanceBetween
Use a sampler info node for determine which point is calculating. You can use a locator or the sphereShape itself (worldMatrix[0] ?) as second point. Normalize the distance value using a set range or multiply-divide node, then connect to a ramp. That's it (i hope:p )
The Commander
05-06-2003, 08:33 AM
Blimey that was quick! I'll give that distance command a try Augustus, it sounds promising. Its meant to be like a creature trying to force its way out of a soft egg - hence, shell colour is stretched and the creatures skin beneath shows through.
As to the extrude problem, we tried all the extrude types (tube, flat...) and they don't fix it, in fact, flat is the closest on to sanity in this case. Take a look what happens with tube:
Weird huh? The circle not only doesn't follow the line facing forwards, it randomly scales along the way! I can post the file on here probably if anyone fancies tackling this one hand to hand.
ntmonkey
05-06-2003, 04:46 PM
Commander,
I feel cheeky today. Gimme that problematic extrude and I'll fix it! BTW, when you extrude, do you place the profile curve right up to the beginning of the path curve so Maya doesn't have to think as hard. Sometimes this gets rid of a lot of extruding problems. From the sound of it, you're doing it right, just not the right result. Post it up here and I'll see if I can't unwrangle it for ya.
Lu
Duncan
05-06-2003, 05:20 PM
I would use a deformer for the bulge. To do the shading create a 2D texture with a spherical projection. One the projection node turn off wrap and increase the blend value. You should have a smooth edged spherical blob of the texture with the default color everywhere else. Now group the projection for the spherical projection with your deform and animate the position of the deformer.
Duncan
larryvm
05-06-2003, 06:24 PM
for the shader, i use a samplerinfo that say me the local position of the point being sampler and a set range and a ramp
with this i do a expresion of the long of this point from the 0.0.0 and connect the output to a set range
setRange1.valueX=sqrt(samplerInfo1.pointObjX*samplerInfo1.pointObjX+samplerInfo1.pointObjY*samplerInfo1.pointObjY+samplerInfo1.pointObjZ*samplerInfo1.pointObjZ)
connect the output of the set range to the ramp and the ramp to a lambert
you only have to find the values on the set range old input values to match the ramp, the new values must be min 0 and max 1
augustus
05-06-2003, 08:52 PM
I did a test for shader, works good.
http://august.f2o.org/resimler/distanceshader_old.jpg
gmask
05-06-2003, 09:14 PM
Originally posted by augustus
I did a test for shader, works good.
Looks cool.. I'm still confused about the distancebetween part of the sahder network though??
The Commander
05-06-2003, 10:13 PM
"Hi Folks, and welcome to another show of 'Thats Amazing!
Today, we have the talented chaps at CGTalk.com."
"Wow, Thats Amazing!"
"Y'see, they've achieved in 1 day what the most smart guys on my entire degree class couldn't do."
"Thats Amazing!"
Augustus, that is remarkable. Now if I can just put that together myself we'll be away...
ntmonkey, I'll mail that file in just a tick. My PC's having a fit right now. It might not be quite what you're expecting, but good luck anyhow...
stunndman
05-07-2003, 12:59 AM
the distanceBetween node takes two points as its input and calculates the distance between them - the output is a scalar
here's a quick scene set up
instead of using a locator i used the scale pivot point of the nurbs sphere transformation node
http://alienbit.com/shared/distanceBetweenSample.ma
gmask
05-07-2003, 01:06 AM
Originally posted by stunndman
the distanceBetween node takes two points as its input and calculates the distance between them - the output is a scalar
here's a quick scene set up
instead of using a locator i used the scale pivot point of the nurbs sphere transformation node
http://alienbit.com/shared/distanceBetweenSample.ma
Thanks but for some reason I cannot open or import that scene file?
I understand how to create and connect all but that node? Is it the expression Larryvm posted?
stunndman
05-07-2003, 01:29 AM
that's one of the quite useful nodes that don't don't show up anywhere in the interface - you have to create them by hand - at least they are documented in the node reference
createNode distanceBetween;
and give the file another try - i think i have removed a bit too much from the file
gmask
05-07-2003, 01:36 AM
Originally posted by stunndman
that's one of the quite useful nodes that don't don't show up anywhere in the interface - you have to create them by hand - at least they are documented in the node reference
createNode distanceBetween;
and give the file another try - i think i have removed a bit too much from the file
Aww.. that helps! Thanks ;-)
gmask
05-07-2003, 04:17 AM
Originally posted by stunndman
that's one of the quite useful nodes that don't don't show up anywhere in the interface - you have to create them by hand - at least they are documented in the node reference
createNode distanceBetween;
and give the file another try - i think i have removed a bit too much from the file
I got the scene file to work .. The network is different than the screen shot but works pretty well. Cool! :drool:
ntmonkey
05-07-2003, 06:13 AM
Commander,
That ball of stringy linear curves is a lost cause my friend! However, I think I know what's going on and how to fix it in a dumb way though I'm sure you're not going to do it this way. Here goes, and folks, feel free to let me know if I'm wrong:
The extrude doesn't work right because Maya only checks the direction of a curve at CVs. Well, with your ball of string, the CVs are only at those less 90 degree curves and the extrude freaks out. Its sorta like that circle wants to turn but there's some kinda mathmatical inertia that prevents it from getting all the way to face the new curve direction. And before it gets to the direction its facing, the curve changes again and maya flops down and gives you this garbage thus causing the chain-reaction call BLUH!
The fix I found, and don't do this unless you really have to:
Add knots inbetween (sorta the middle, and some need 2 or even 3) the break-neck bends and the extrude checks half way between each of those turns. I found the results came out a whole lot better but I only placed like 10 to make sure it would work further down the line.
Sorry. I gave it my best shot.
Lu
ntmonkey
05-07-2003, 06:14 AM
BTW Commander, what are you trying to do?
augustus
05-07-2003, 06:52 AM
Now i'm thinking about this: What if the undistorted shape is not a perfect sphere? Maybe an undistorted copy can be used as a reference, and closestPointOnSurface node to determine second point for distance calculation. What do you think about that?
*Sorry for my English.
The Commander
05-07-2003, 08:30 AM
Originally posted by ntmonkey
Sorry. I gave it my best shot.
Lu
Ah well, sorta half expected that. We thought that might be the problem. Unfortunately, we have to keep the number of points to an absolute minimum to save memory and keep the lines dead straight. Thanks for having a crack at it and anyway, knowing for surewhats wrong with it is good enough. Its not a critical problem.
As to what it is; One of our projects at University is to make an abstract 30 second animation which will show the user some sort of change.
Our group decided it would be cool to start with a simple sphere and expand from that to a much larger sphere by way of it 'growing'. Its gone a bit more crazy since then but thats prettty much it.
I don't have any webspace so I can't post a playblast of the tests. The clip I sent you is just a piece of the animation, the actual file uses 10,000 (I think) points to make a dense enough sphere of CV's.
augustus
05-07-2003, 06:18 PM
If you interested:
http://august.f2o.org/resimler/distance.jpg
Shader network:
http://august.f2o.org/resimler/distanceshader.jpg
And scene file (http://august.f2o.org/sceneFiles/distance.mb)
Edit: Caution! It makes Maya so sssllooww:annoyed:
gmask
05-07-2003, 06:31 PM
Originally posted by augustus
If you interested:
And scene file (http://august.f2o.org/sceneFiles/distance.mb)
Edit: Caution! It makes Maya so sssllooww:annoyed:
Very cool!.. but could you save it as ascii? Thanks
augustus
05-07-2003, 06:45 PM
http://august.f2o.org/sceneFiles/distance.ma
Do binary files have a compability issue or something?
gmask
05-07-2003, 06:50 PM
Originally posted by augustus
http://august.f2o.org/sceneFiles/distance.ma
Do binary files have a compability issue or something?
Well it is when you want to open a maya 4.5 or 5 file in Maya 4..
BTW you weren't kidding about it being slow!!! ARGHHH!!!
Duncan
05-07-2003, 07:35 PM
The solution I posted earlier should not be slow. Was there a problem with it?
Duncan
gmask
05-07-2003, 08:56 PM
Originally posted by Duncan
The solution I posted earlier should not be slow. Was there a problem with it?
Duncan
I dunno if your method would do exactly what augustus' solution does..try it out.
For me these are new ways to accomplish certain tasks that had not occured to me..I would have taken a different approach altogether than coincidentally would be less calculation intensive.
Duncan
05-07-2003, 09:26 PM
I tried it and my method works. Render time is fast. A nice plus is that you can move the bump across the object in real time in shaded mode and have the color track where the bump is. (it helps when you write this stuff)
Here is a more explicit workflow:
Create a poly sphere ( or any geometry with lots of cvs ).
Deform->createScuptDeformer
Edit the sculpt node:
make Mode = flip
DeformerAttributes->envelope = 0.6
Map the color of the object's shader with a ramp texture, asProjection = true.
Edit the projection node:
projType = spherical
Effects->blend = 1
Parent the place3dTexture node for the projection to the sculptor node. Scale it to be about 50% larger than the sculptor node.
Make the ramp texture all red, if desired.
Toggle shaded/textured mode. You should now be able to move the sculpt node around, creating a moving red bump that fades out with distance to the center of the bump.
You can create multiple bumps using multiple deformers and by mapping new textures to the default color attribute of the projection nodes( in a daisy chain fashion ).
Try it!
Duncan
gmask
05-07-2003, 09:29 PM
Originally posted by Duncan
You can create multiple bumps using multiple deformers and by mapping new textures to the default color attribute of the projection nodes( in a daisy chain fashion ).
I will try that.. although I'm thinking that one advantage the other solution has is that is should work with displacment maps and don't need to daisy chain a large number of deformers.
Duncan
05-07-2003, 10:11 PM
If you want a solution that works with displacement maps, then simply take the displacement map and use it for color as well as displacement, no?
Duncan
gmask
05-07-2003, 10:32 PM
Originally posted by Duncan
If you want a solution that works with displacement maps, then simply take the displacement map and use it for color as well as displacement, no?
Duncan
Yeah but what if it's an animated displacement map..
Duncan
05-07-2003, 11:15 PM
If you have a connection from the displacement texture to your color, your color will automatically change as the displacement texture animates(be it an animated file texture sequence or a texture with keyframes). Perhaps I'm missing what you are driving at.
Duncan
gmask
05-07-2003, 11:55 PM
Originally posted by Duncan
If you have a connection from the displacement texture to your color, your color will automatically change as the displacement texture animates(be it an animated file texture sequence or a texture with keyframes). Perhaps I'm missing what you are driving at.
I dunno.. I'm just thinking of various effects with nothing in particular in mind.
augustus
05-08-2003, 06:48 AM
Duncan, your solution looks cool, i'll definetaly try this. :thumbsup: But as i understand, The Commander has already made animation, and need only a shader chances color when object deforms. Maybe his (her?) way is not easiest. Well, i would prefer an expression driven displacement map, like raindrop effect, or your solution, but i can't say waste whole animation.
Also, the solution i've posted is not slow. Second one is slow yes, but it's not a solution for The Commander's problem:shrug: I'm just trying another possibilities. I'm a newbie you know ;)
Thanks for sclupt-node tip:)
The Commander
05-13-2003, 02:36 AM
Hi, sorry to bring this up again, but we're stuck. Not to hot on complex texturing.
We managed to build the network in the Hypershade (hardest thing I've ever done in that - I haven't scripted at all before really). However, we can't figure out what do you have to do to get a colour change.
We reckon its all in the samplerinfo, but we're not sure what to do with it. Thanks for everyones input btw. :thumbsup: !
gmask
05-13-2003, 02:49 AM
Originally posted by The Commander
We reckon its all in the samplerinfo, but we're not sure what to do with it. Thanks for everyones input btw. :thumbsup: !
Actually you don't really have to do anything to the samplerinfo node. You connect samplerinfo and the locator to the centerpoint node. You may to do a test render to see the resutls or click in the data boxes of one of the nodes to force it to update.
The Commander
05-13-2003, 02:56 AM
In that case we must have done something wrong. There is no effect.
If its of any relevance, we used the sculpt tool to do the deform.
augustus
05-13-2003, 06:32 AM
In the network i setup, you need to tweak setRange and ramp nodes. Make oldMin and oldMax values of setRange node as narrow as you can. You can add a clamp node to crop high values. And in ramp node, remember to add another point to pull 2nd color down.
CGTalk Moderation
01-15-2006, 01:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.