Previous Entry: “Mixing HTML and TeX in a StyledTextCtrl in wxPython”
Next Entry: “Making the AnaglyphWebGLRenderer a bit more protruding”
Per default, the imaginary Trackball fills the entire available browser window. This is less than ideal if the actual WebGL canvas is just a tiny illustration within a larger text:
Even more problematic is when the canvas element is part of a page that doesn’t fit on the screen (if the web page is several screen pages tall). In that case, the imaginary trackball and the canvas element might be more or less unrelated, and the control can behave strange and unexpected.
As the next best thing, I decided to wait for the first mouse click for my adjustment of the imaginary trackball. If the user is able to click on the canvas element, then it should also be part of the document tree and posses a size and a position I can use.
I wrote my own version of TrackballControls, TinyTrackballControls, defined in a file TinyTrackballControls.js.
This red icosahedron uses the ordinary TrackballControls:
Nothing to see, since your browser doesn’t support the canvas element.
So far away from the top of the page and shifted to the left, it works really bad, since the trackball center and the icosahedron center don’t align well.
This green icosahedron uses my TinyTrackballControls:
Still nothing to see, sorry.
To use it, you can call it like you would call an ordinary TrackballControll. Everything else is done automatically:
(Linear | Threaded)
The only problem I had here was that when the moedls are exported from Blender they are repositioned to 0,0,0 rather than the position they should be so once loading them into the scene there was quite a bit of re-jigging to make sure that the model was positioned nicely in its place, so some of my model parts may be slightly off but they seem to look ok to me.Nice car You should be able to set align model to none in the latest Blender exporter so that world coordinates will not get touched (it's now default mode, before default was center ).Also you may try fresh new experimental scene export option to export the whole scene at once (as one scene file plus one file per each unique mesh), though there are still some problems with rotations.
The only problem I had here was that when the models are exported from Blender they are repositioned to 0,0,0 rather than the position they should be so once loading them into the scene there was quite a bit of re-jigging to make sure that the model was positioned nicely in its place, so some of my model parts may be slightly off but they seem to look ok to me.Nice car You should be able to set “align model” to “none” in the latest Blender exporter so that world coordinates will not get touched (it’s now default mode, before default was “center”).Also you may try fresh new experimental scene export option to export the whole scene at once (as one scene file plus one file per each unique mesh), though there are still some problems with rotations.
<a href="http://www.vehicleinsuronline.net/">insurance auto</a> <a href="http://www.autoinsuroptions.com/">car insurance in florida</a>
Cheers, very nice 3D engine, I doth my cap to yourself and Mr Doob I did notice that about 10 minutes after I pressed publish on this post that r38 was pushed to github with *a lot* of Blender love so will be downloading that soon as and having a play.
<a href="http://www.getallergytreatment.com/">order prednisone online</a> <a href="http://www.menshealthmeds.net/">cialis online</a>
Great work, really appreciated. You avoided me a lot of headaches. Thank you!
I noticed that the "radius" property doesn't work. Changing the radius property of the "THREE.TinyTrackballControls" object seems to have no effect. Is it a desidered behaviour? My (very simple) example is here: http://marticus.net/track Again thank you for your work
Kind of. I compute a sensible value for the radius internally as soon as the control is touched for the first time; this way, I'm sure that the canvas is already inserted into the page. You set the radius when you define the control, before anything is rendered at all, so that your setting gets overwritten as soon as I'm doing my calculation. There are several ways to hack this: set another new value like "xradius", and change my script to read this value instead, and push it into "radius". Or hardcode the radius. Or something else.
Latest Skizzenblog Entry