Issue with wireframe parameter for quad faces (in r60)
R60: Seems that the wireframe is shown for the actual triangles that are rendered. R59: Meshes with quad faces are rendered as quad faces in wireframe mode.
So I'm hoping this is an issue, not a changing in the behaviour of this wireframe parameter for materials. Since I want to draw cubes with their edges shown.
Test Code:
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);
camera.position.z = 5;
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
var geometry = new THREE.CubeGeometry(1,1,1);
var material = new THREE.MeshBasicMaterial({color: 0x00ff00,wireframe: true});
var cube = new THREE.Mesh(geometry, material);
scene.add(cube);
var render = function () {
requestAnimationFrame(render);
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
renderer.render(scene, camera);
};
render();
see release notes and wiki->migration. Face4 stuff has been removed. (although it is still in the lib and you could create a "face4" object. I think the easiest solution for you would be to take all "edge -vertices" and create your own Three.Line object for quad wireframe. At least this is easily possible. maybe there should be a quad-wireframe option in three.js . Anyway, on a last note: As stated in the guidelines, help requests should be directed to stackoverflow. This board is for bugs or feature requests
Thanks for the quick/instant answer and for the tip. I really hoped it was a bug not a feature.
(...I am using threejs in an architectural context, so quad faces are essential for me. If there is a way to support it in the future I would appreciate that.)
Is it only for cubes? If so, you can use this code for creating a wireframe cube without triangles.
Thanks for the tip/resource.
Actually I want to load a collada file and visualize the objects with shading and lines. ...my plan now is to extend/customize the ColladaLoader to build a scene graph of group objects with a nested solid object and a nested line object for each geometry collada node (instead of only the geometry objects itself).
btw, this is an exellent (easy-to-use and fast) 3d engine. great work.
The loss of Face4 and the new appearance of diagonals in wireframe materials is a huge loss for designers.
How to encapsulate this in a few words? How's this (opinion): Things that used to be pretty are now ugly.
Previously wireframe was part of the designer's tool kit. Now it merely serves for debugging code.
Please, please bring back the quad wireframe capability using some method us non-techies can deal with...
Hi @theo-armour
Quads are gone, so there is no way to know where you would want the diagonals omitted on an imported model. On the other hand, CubeGeometry could have some feature to render wireframes without diagonals.
What exactly is your use case, and what feature would you like to see?
The loss of Face4 and the new appearance of diagonals in wireframe materials is a huge loss for designers.
I'm well aware of that. But I think over time we'll be able to solve the problem in a different way (using Line generators instead) which is the right way.
Automatic wireframe wasn't optimal. There were many duplicate lines being processed/drawn.
@WestLangley
The use case is very much based on aesthetics and intangibles. ;-(
Have a look at this fiddle: http://jsfiddle.net/theo/MPhQv/
[ BTW, it took a bit of a fun effort to find out how to display old and new behaviors side by side using only the current release - and actually I'm not certain how this even works. So perhaps you will not see what I see: left no diags. right with diags.]
Without the diagonals, things are more like the Platonic solids and less like Aristotelian or empirically confusing things.
This is probably not the use case you are looking for.
In any case, thank you for responding.
@theo-armour
Yes, that use case is somewhat contrived, but I understand that you just don't like the aesthetics of the diagonals.
There are solutions out there. Have a look at this comment, where @Raiment57 provides a link where he uses Line and polygon offset to render the wireframe. This is exactly what @mrdoob suggested above.
Hi WestLangley
There are solutions out there. Have a look at #3663
Is this some kind of puzzle? Where do you see the solution?
Theo
On Sun, Aug 25, 2013 at 2:25 AM, WestLangley [email protected]:
@theo-armour https://github.com/theo-armour
Yes, that use case is somewhat contrived, but I understand that you just don't like the aesthetics of the diagonals.
There are solutions out there. Have a look at #3663https://github.com/mrdoob/three.js/issues/3663#issuecomment-23080512
— Reply to this email directly or view it on GitHubhttps://github.com/mrdoob/three.js/issues/3788#issuecomment-23224635 .
@theo-armour I expanded my previous comment to make it more clear. Perhaps a similar solution will be integrated into three.js at some point.
+1 for the idea of having this supported by three.js directly (i.e. without extra application-side workarounds). Not for laziness but for maintainability - the "preferred" stroke style should be ideally supported and maintained across versions by the library rather than by the application... https://github.com/mrdoob/three.js/issues/92
I agree. We're not there yet though. We have a lot of code to clean up still.