-
-
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
Events, Text and lines? #2
Comments
Text and lines is doable. Make them clickable, I don't know how would I do that right now. |
I might be able to sidestep events. I could possibly put a menu on the side. Not optimal, but text and lines would be enough for me to make this workable. Again, thanks for the great library :) Cheers, |
I've implemented rudimentary support for lines - at least using Canvas, not sure how well the SVG implementation works yet. Its certainly not optimised and has a few minor bugs, but it works well enough at the moment. Do note that I've changed the project structure somewhat - I will bring it back into line at some stage in the future. You can see it at work in the cylinder example (same directory as the cube example) |
Text would be an excellent addition that I could make use of as well. +1 for text feature request! |
Is that 2d text (as in text that gets written in 2d but using the z position for scaling) or 3d text? |
Something along the lines of http://murfy.de/read/webgl-text-rendering would be awesome... I'm not sure if this is possible with Canvas, but it seems to be possible with webGL. |
mrdoob: good point, 3d text, ie. what jurjen is suggesting would probably be much more difficult in Canvas however it is what I had in mind as well. |
nm, my understanding of canvas transforms is limited and evidently this is probably fairly doable: http://stackoverflow.com/questions/2749474/how-do-i-skew-the-text-generated-by-filltext-for-the-canvas-tag-in-html5 |
Oh, but that's just a texture. You can do that already. Create a canvas, write some text on it. And use that with a BitmapUVMappingMaterial. The video demo is pretty much just that: http://mrdoob.com/projects/three.js/examples/materials_video.html In fact, it updates the texture every frame, you could update your canvas with a new text every frame too. |
This is how you write text in a canvas: |
I've just done a very rough implementation that works with Plane() objects, basically it is a modification of the geometry_vr examples, but instead of loading an image, it draws text on a canvas, then uses canvas.getImageData as the source
I want to create another primitive (eg a modified Cube.js) that maps an image to each face, but haven't quite got my head around the geometry.vertices / geometry.uvs / geometry.faces interplay yet... |
Exactly that :) Yeah, I wanted to update the Cube pimitive too, but dealing with the subdivision and uvs stuff... If you want to get it done quickly, you can do a cube in Blender (2.5) subdivide it, and export it to a Geometry class using the Blender export you'll find in the /utils folder :) |
jurjen your too fast for me - so I went away, learnt the canvas text api and made some text based on the particle primitive. I'm not sure if this will render any faster then the material bitmap method but it does also allow us to display text with the option of enabling the camera matrix (or not) and the camera projection matrix (or not) so that the text can scale (or not) and skew (or not) based on what you need atm. Dono if this is still useful, next time I'll check the convo before launching into gedit for hours :) |
gah, just figured out what the _bboxRect does.. I'll have to go back and finish a few things on this but it's 90% there in my current commit. BBL with more (after sleep). |
This is beginning to look awesome (as for me, 2D text fits my needs, but I can understand that others need 3D). You guys rock :) |
got the text scaling now.. anyone know how to use either transform or scale and rotate to skew the text like a 3d object? screen shots: http://imgur.com/a/5EAVM/threejs_2d_text_demo |
Oh man, what's with imgur and my connection? :/ ImageShack? TinyPic? |
i might be uploading way to big images.. i'll try scaling them down a bit next time.. anyways heres a tinypic: http://tinypic.com/view.php?pic=wjxwky&s=3 |
Looks good! Uhm. I think I'll merge it with the particle stuff. This is what I'm doing: Until now a particle could be only represented as a circle. I'm moving it so the representation is defined by the material. Now it's like this:
I'm changing it to this:
CircleParticleMaterial could also specify borders and stuff. Having this like that, I was then going to do How does this sound? |
sounds good! |
on the topic of onClick, etc. events they should be doable as well but with some effort. The problem of clicking on objects (and dragging them, etc.) is called picking and is described fairly well if you google it. To help get this started heres a snippet of the code I use (built on top of my own code and three.js) to click and drag move an object on the x,y plain at z=0 => http://gist.github.com/474839 if events integrated with jquery's bind that'd be awesome too :) |
A friend was suggesting having bounding spheres for each object, so you would test the ray with the spheres which seems to be the simples operation, once you hit one then you can test the triangles. Uhm, sounds exciting, I wish I could get into it just now :D |
I forgot to mention my fork has inversions for 4d matricies added to it which are sort of necessary for picking since you need to invert the camera matrix. Not really sure how to merge that fork back in to mr. doobs though so many commits later... help? |
How does this look? :) |
w00t! Shiny happy D1plo1d codes :D I'll have to merge in the rest at some point (returning 'this' from all the imperative functions so functions can be strung together like in jquery: myMatrix.multiplySelf(a).transform(b) was probably one of the more useful things in every day use) ... anyways I'm going to release the three.js part of my project soon(ish) and hopefully that'll demo exactly what all this strange hackery did ;) |
Looking forward! :D |
Do you guys have any updates for text support? I'm playing with three.js and I was wondering if 3js can support 3D text. |
Mhh... Could you do a quick drawing of what you want to achieve? That will speed up communication. |
I got Three.js to render 3D letters by exporting the letters from Blender 2.5 -- so basically it's like the rat demo. I haven't played with the materials yet so not sure how it'd all fit in. But I got the letters to render, pretty exciting! |
\o/ |
Merge dev to branch
Adding rectAreaLightShadow
Examples: specify tone mapping exposure for clarity #2
Gltf loader get parser
Merge with main repo
…tch-2 Update README.md
* Updated implementation of multiview on clean branch * Lint fix
Absolutely lovely!
What would be the difficulty in adding text to each particle? I have a personal project I would love to incorporate this into, but without being able to add labels, it would be difficult for users to know what's going on.
Being able to draw lines between particles would also be useful, along with event handlers per particle (at the very least, associate a URL with them so that if I click on it, I could "drill down" or go to a page which explains what the user is looking at.
Cheers,
Ovid
The text was updated successfully, but these errors were encountered: