canvas3D | Utah teapot 3D HTML5 canvas realization | Canvas library
kandi X-RAY | canvas3D Summary
kandi X-RAY | canvas3D Summary
3D HTML5 canvas realization based on 2D and WebGL context. Examples: * 2D: [Cube] (see Cube function in source code) * 2D: [Suzanne monkey] * 2D: [Utah teapot] * WebGL: [Suzanne monkey] * WebGL: [Utah teapot] Features: * 3D operations: rotating, moving object center * Ambient light (only WebGL) * Directional light * Perspetive camera (only WebGL) * Highlighting edges (only 2D) * Painter’s algorithm for sorting polygons (only 2D) * Optimizations (only 2D): Skip processing of invisible polygons, skip processing of duplicated points, normals. Warning! canvas-ply-reader.html and webgl-ply-reader.html won’t work from disk because it uses AJAX to load .ply model file.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of canvas3D
canvas3D Key Features
canvas3D Examples and Code Snippets
Community Discussions
Trending Discussions on canvas3D
QUESTION
In my application I NEED to make sure that Canvas is actually appeared on the screen before going for the next step. The reason is that I need to retrieve an AWT Drawable - i.e. the native window surface of that canvas. And that drawable would be invalid if the canvas is not visible, even if it has the flag "visible" set to true.
The problem Im having is that I can't be sure when Java actually decides to display it.
I even made a code to actually delay after Canvas constructor, but what happens is that it is displayed AFTER the delay has expired.
...ANSWER
Answered 2020-Aug-04 at 08:41It seems that I can use canvas.isShowing() to test if it's actually visible on the screen. At least by checking that parameter I got the result I wanted (so far).
I am still not certain if that's enough and if there's something more that can go wrong on the low level, particularly if I try to access the surface during X11 rendering pipeline where AWT has already completely "displayed" the component but X11 hasn't yet finished drawing it on the screen. That's one concern.
But for now, it seems to be the best answer I can come up with.
QUESTION
I use the Three.js canvas inside a tab container but for some unknown reason, the 3D viewport is not inhered the full width & height of the parent element.
@description
I have 2 tabs the first tab is active in the second tab is where I have the 3D viewport (canvas).
...ANSWER
Answered 2018-Mar-08 at 14:34(VW) unit on CSS code I just say the parent width to be
#canvas3D {
width: calc(100vw - 60px); height: calc(100vh - 60px);
}
I hope someone is gonna helped :)
QUESTION
I'm trying to add a 2D overlay for a 3D scene in Java3D, part of this overlay is to draw a line from a 2D object to a corresponding point in the 3D scene...
Searched transformation from 3D to 2D and read those threads:
from code inside walrus: https://github.com/CAIDA/walrus/blob/master/H3ViewParameters.java
copied a method to a class extending Canvas3D:
...ANSWER
Answered 2018-Aug-27 at 21:22This can be done by using getVworldToImagePlate
and then getPixelLocationFromImagePlate
in the Canvas3D
class. For example:
QUESTION
I'm trying to load .obj file from blender to Java3D but error always occur:
com.sun.j3d.utils.image.ImageException: javax.imageio.IIOException: Can't get input stream from URL!
The weirdest thing of it all is that when i load model from web everything is ok but when i import same file to blender and then export it (without any change) it doesn't work.
...ANSWER
Answered 2018-Aug-23 at 11:28Please try the following steps:
[1] Open the .mtl file, and make sure all texture paths are relative like this:
map_Kd female02_1.jpg
Not like this:
map_Kd C:\Users\Username\MyJava3D\Female02\model\female02_1.jpg (absolute path)
On my PCs, if texture paths are not correct, that error occurs in Java3D 1.5.1. In Java3D 1.6.0, no error occurs, but the textures do not show up.
Are you talking about female02.obj in Sweet Home 3D? (I'm just guessing from the file name "female2.obj.") If so, [2] and [3] are needed.
[2] For multiple textures, check "Objects as OBJ Groups" and "Material Groups" (on the lower left corner) before exporting the model. Otherwise, the textures won't show up.
[3] For the .obj file, the textures may not show up properly. If so, flip all normals outside.
Blender 2.77:
For each part (hair, face, dress, ....)
1) In the Object mode, right-click the part.
2) Press the Tab key to enter the Edit mode.
3) In the 3D View window, press Ctrl-n several times.
4) Press the Tab key to enter the Object mode.
5) Repeat steps 1) to 4) above.
[4] Also, comment out all the lines beginning with 'o' in the exported .obj file. Otherwise, the following error occurs: com.sun.j3d.loaders.ParsingErrorException: Unrecognized token, line~
QUESTION
I'm a beginner in WPF, so I don't understand exactly how C# works with XAML to make the application.
I'm trying to make a software to draw and manipulate 3D geometry. I've followed this example on how to create a 3D scene and was succesful.
But, when I try to put the Viewport3D
inside a canvas
in XAML (so that I can place other elements like buttons in the UI to manipulate the 3D scene), I can't figure out why the Viewport3D
doesn't show up.
I don't want to define everything of the Viewport3D
in XAML because I plan to have more complex operations of drawing and manipulation of geometry. And I think it is better to do it in C#.
The MainWindow from the C# file isn't the same on the XAML file?
Here is the window I get:
Here is the code:
XAML
...ANSWER
Answered 2018-Jul-09 at 04:33If the intention is to overlay UI elements it might be easier to nest the canvas and the Viewport3D in a grid.
QUESTION
I'm making a webgl demo with md2 models. I know that it is an old format but I need to use only md2.
I read the documentation for the md2 format.
I watched how this site works: and used part of it's sources in my program (i saved the author's name in the comments)
I made vertex loading, the model loads great!
But when I'm trying to map the texutre, something strange happens:
First, I thought that it's the problem of fragment shader, but I made an export by using assimp2json, used the data from it and it was drawn as it should draw.
The problem is that assimp2json changed the order vertices in triangles and uvs order, so I can't debug the program using it.
Maybe, someone could help to find the bug, to point to the error in my code?
P. S. since there is no animation, I only use the first frame
The most interesting is that if I will pass unindexed data (just the uvs from the file) it looks more right than the indexed textures:
The problem is that it is wrong in some places, like here:
Full source code and models:
ShaderProgram.js
...ANSWER
Answered 2017-Sep-27 at 11:43The solution was to delete index buffer and place everything in the vertex buffer. It worked for me
QUESTION
I'm developing a JavaFX desktop application. In it I want to display some java 3D objects.
The way to do this, as far as I know, is using JavaFX's SwingNode. Java 3d has to be integrated in a Swing component too. So it's a two-step process.
Integrating Java 3D objects with Java Swing
Complete and minimal example composed of the panel I intend to reuse in the FX app and a JFrame that shows it works:
...ANSWER
Answered 2017-Aug-16 at 18:00If these two sentences "I'm developing a JavaFX desktop application. In it I want to display some java 3D objects." are really the essence of what you are asking here, then you are completely on the wrong track. JavaFX supports 3D shapes natively, so unless you have very specific requirements there is no need for any Canvas3D and embedding any Swing.
I just see that you have said that you know the JavaFX 3D graphics but you don't like it. Could you be a bit more specific about what you don't like?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install canvas3D
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page