-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parametric Surfaces #1683
Comments
Haha, this is getting crazy indeed :) |
So |
well, both are possible - we can even go to more extremes Ok, now see http://jsbin.com/urahod/4/edit Now notice these points that might occur after switching to using a parametric geometry for sphere
As far as |
okay, now compare |
Nice! :D
Yep, but I'm also worried about filesize. And there is a lot of dupe code in these geometries... |
reduced filesize - perhaps :) efficiency - perhaps more objects are created, but might or might not have any hit.. okay, i gotta reinstall git sometime soon... |
The UVs gonna be an interesting problem for parametric surfaces. Not sure if we gonna have one way of doing it, or have multiple UV mapping strategies. So I wrote a little UV helper to help with understanding the current UV system and debugging. Live link for the common THREE geometries http://jsbin.com/ujejuq/edit#javascript,live Hopefully this would also help in debugging UV problems such as #1396 #1645 #1288 Most of it are boring grids others than these (and perhaps exported UV unwarps) |
UVs is another deep rabbit hole again... perhaps we could also do something like this http://www.briankadar.com/blog/2009/03/dynamic-uv-texture-mapping/
which is also relating to the topic in #1396 |
Yup, isn't that the same as this? THREE.GeometryUtils.UVMapSphere( geometry, matrix );
THREE.GeometryUtils.UVMapCylinder( geometry, matrix );
THREE.GeometryUtils.UVMapCube( geometry, matrix );
THREE.GeometryUtils.UVMapFlat( geometry, matrix ); However, that would work work for simple objects such as cubes, spheres and so on. But Torus Knots? |
yes, similar... :) except that we haven't implemented it yet right? what's the |
TorusKnots could use Cylinder mapping I think. As long we are not dealing with complex models yet.. I was reading about LSCM while on the topic... http://www.blender.org/download/sandbox/lscm-basics/ |
For rotating the mapping. For example, if you're doing Flat mapping you can use the matrix for controlling where to project from.
I don't think that would look good, TorusKnot needs it's own custom mapping, no? |
hmm.. i realized we might be talking about different UV approaches. What you seem to be saying for those util classes to project UV (un)mapping from the real world coordinates of the geometry's vertex/faces. I was rather thinking about the old way our UVs were done, if you look at the current UVs of Parametric Surfaces by definition on wikipedia is Since @gyuque and @alteredq both worked on the UVs of |
oh was @WestLangley also mentioning on that the |
Ah! I'm starting to understand now... :) |
Yes, he did say that, but he might not be correct... In your (awesome) plots above, why does vertex b of face 39 have so many edges? |
@WestLangley hmm... not sure if that's a bug or feature, I supposed that UVs should wrap around to the right of faces 20, 76 -> 37, 77, if UV repeats are enabled correctly. |
@mrdoob so now the "replacement" |
Yup. Sounds good to me! However, instead of this: THREE.PlaneGeometry = function(width, depth, segmentsWidth, segmentsDepth) {
function plane(u, v) {
var x = u * width;
var y = 0;
var z = v * depth;
return new THREE.Vector3(x, y, z);
}
THREE.ParametricGeometry.call(this, plane, segmentsWidth, segmentsDepth);
};
THREE.PlaneGeometry.prototype = new THREE.Geometry();
THREE.PlaneGeometry.prototype.constructor = THREE.PlaneGeometry; I think I would just do this: THREE.PlaneGeometry = function(width, depth, segmentsWidth, segmentsDepth) {
function plane(u, v) {
var x = u * width;
var y = 0;
var z = v * depth;
return new THREE.Vector3(x, y, z);
}
return new THREE.ParametricGeometry(plane, segmentsWidth, segmentsDepth);
}; |
would this mean that the pattern would change? eg. var plane = THREE.PlaneGeometry(100, 100, 10, 10);
var mesh = new THREE.Mesh(plane, material); vs var plane = new THREE.PlaneGeometry(100, 100, 10, 10);
var mesh = new THREE.Mesh(plane, material); |
Oh true. Yeah, it's good as it is then :) |
Morphing parametric geometries test - http://jsdo.it/zz85/rVta |
Nice! :D |
I guess we can close this issue soon, if there's isn't any more problems or requests for this feature :) |
This almost feels like I'm on some crazy geometry spree.
Parametric surfaces ftw, credits to @prideout for his brilliant article http://prideout.net/blog/?p=44
http://jsbin.com/ivekup/3/edit#preview
UVs to be done another day... :)
The text was updated successfully, but these errors were encountered: