I'm trying to make a rubber band in Unity and I don't get out. I found this example but it's done in Actionscript Flash https://www.deviantart.com/willmh93/art/Ball-Elastic-142211333..... and I can't even convert the code to javaScript or C#.
I managed to do something similar, but this one uses line renderer, and it's not so real.
Sling Shot img
My simulation uses the Slingshot mechanism, but it doesn't benefit me. I want to have this rubber band and act on a draggable object.
I don't need you to write me code, but give me some ideas or some sources from which I can orient myself, what and how to use it to get the same result.Thanks a lot.
I believe you are looking for Spring Joint:
https://docs.unity3d.com/Manual/class-SpringJoint.html
It allows you to attach 2 objects with springiness. I'm sure you can fiddle with the values to get a more 'rubber-band' feel.
Related
we have a project at university where we have to create fractals that are controllable by the user (with kinect). We are still in an early phase where we evaluate some ideas (though we already got some working prototypes). Our idea right now is to use a blackboard-image as background and draw the fractals on top of it. To make this look more natural we'd like to use some crayon effects on the lines we draw.
Our internet-research produced two main ideas to achieve this:
Paint an image of a photoshop-like brush for every moueposition of a line.
Use shaders on drawline-functions.
The first does work for an early test, but looks awful. I guess the latter would be the best approach, but the information in the internet seems to be lacking regarding this topic. At least I didn't find anything that really helped a lot. The Questions is:
Has anyone links or general tips on how to achieve this effect, or is it not possible in C#/WPF. Might there be an even better way? And how can I apply a created shader to drawline-method/brushes?
Thanks in advance and kind regards
Michael
EDIT
Nice tip from #Bradley Uffner ! (unfortunately he deleted his answer)
There is a tutorial here on how to achieve such effect :
http://alastaira.wordpress.com/2013/11/01/hand-drawn-shaders-and-creating-tonal-art-maps/
Another thing I've found recently which might interests you :
http://blogs.msdn.com/b/hemipteran/archive/2014/03/26/generating-noise-for-applications.aspx
I've didn't read well the title of your question, Windows Forms do not support shaders at all.
Be more specific about the meaning of a crayon shader
Regarding using shaders in WPF, you cannot apply them at a line-level but on a Control level instead.
This the class representing a shader in WPF:
http://msdn.microsoft.com/en-us/library/system.windows.media.effects.effect(v=vs.110).aspx
What I suggest
use an Image and set its Source property to use a WriteableBitmap
use the excellent WriteableBitmapEx library to easily draw on it, basically it's the WriteableBitmap in WPF but with many extension methods for drawing lines, circles, rectangles etc ...
then apply your shader to the Effect property of Image
For developing your shader
Use Shazzam, it allows you to develop an HLSL shader for WPF in a cool interface, preview it instantly and it will generate the Effect class ready to paste on your project.
There might be a couple of interesting shader for you in DOSBox SVN-Daum
Here's an example of the cartoon shader :
Obviously there will be quite some work as copy-pasting the shader to Shazzam won't work right away but you'll know what are the maths behind achieving the effect.
Mark the answer as accepted if you are satisfied with it :D if not edit your question and add more details.
I am working with XNA 3.0 (sigh, I know) and I am working off a tutorial that helps implement a 3d scene with objects where a spot light hits a torus and projects a hard-edged shadow. Now, I want to know where I can find help (tutorial, source code, snippet) to soften said shadow?
Simplest way would be use Percentage Closer Filtering. Basically it works by taking a few shadow map samples. You can start from an article in GPU Gems.
I have this image...
I would like to transform it perspective like this via code...
Is that possible in MonoTouch?
Without having tried it, but as Monotouch sits on top of its ObjectiveC counterpart and binds almost all its API, I would say yes and therefore you may want to refer to this question here on Stackoverflow
Tilt image with UIKit
and that one
How do I apply a perspective transform to a UIView?
They deal with almost the same effect you want to achieve. You should be able to translate the code into Monotouch pretty easily.
Happy coding.
i have been searching for long in order to find how i can place a sphere/cube around my playfield so ill have an effect similar to sky. I have seen SkySpheres/Boxes but couldnt implement them . Im looking for a rather simple solution since my play field is really small and i just need something to replace the Clear(Color.Black) .I dont care about collision i just need it to be there with a texture on . Thanks !
You should take a look at Riemers XNA Tutorial
HERE is the post on the skybox.
Can someone point me to a C# open source implementaion with a simple image animations.
e.g. I feed the input image to animator, and the animation code produces a few dozen of images which if displayed sequentially looks like animation.
I am not something extremely fancy - a simple DirectX filter like animations would do.
You would be look for a sprite then? Microsoft has tutorials on this including:
http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=en-US&EventID=1032273446&CountryCode=US
and general graphics in C# here:
http://www.microsoft.com/events/series/msdnvisualcsharp.aspx?tab=webcasts
Hmmm... I'm not sure if this is what you want, but I've have created a library called Transitions that lets you animate most properties of UI controls easily. You could use it to move the position of pictures, transition between pictures or grow and shrink pictures. But I'm not sure that this is exactly the effects you're after? Anyway, if it's any help, my library is here:
http://code.google.com/p/dot-net-transitions/