Bezier Curves and Car Manufacturers
Michael has asked me if it was possible to add Bezier curves to Live Geometry. So I went ahead and added a Bezier tool (and it took me about 30 minutes to do so!):
This draws a cubic Bezier curve using four points:
There is something beautiful and elegant about these curves. No wonder industrial designers use it a lot. I actually felt so inspired that I went ahead and used the tool to design a car :) Here's the live view (you need Silverlight 3 to see this), and you can drag the points around:
This is so fascinating. Maybe if I'm tired of programming I should just design cars? ;) Any recruiters from Subaru reading this?
I also built in a possibility to pass arguments to Live Geometry using initParams:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="LiveGeometry.xap"/> <param name="initParams" value="LoadFile=http://guilabs.de/geometry/drawings/fun/car.lgf,ShowToolbar=false" /> ...
That's how I was able to embed Live Geometry into this page so that it doesn't show the toolbar and it automatically loads the car.lgf drawing.
Finally, here are some important things to know if you want to host a .xap file from another domain:
- That domain must have crossdomain.xml at its root (so http://livegeometry.com/crossdomain.xml should be accessible)
- If you're testing this by loading an .html file from a local filesystem, it will just display a white background and won't load the app. Put the .html on a webserver, then it will work