Search the Community

Showing results for tags 'normals'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 18 results

  1. Hello ! I need some help, after looking through many threads relating to rotation/orientation/translation, I still couldn't manage to find a solution... I made a playground : There is a Ground with a height map, when you click on the ground, a flat Plane appears where you click. With pickingInfo, I could modify the position of the plane, but I'd like also the plane to change its orientation to match the orientation of the ground. https://www.babylonjs-playground.com/#95PXRY#28 Any help with this script would be greatly appreciated 😀
  2. Strange flickering on a glTF mesh with DefaultEnvironment www.babylonjs-playground.com/#T7A2L7#3
  3. Hello, I'm animating vehicles on paths, and have no flipping until I get to a heart shape. The curve is less than others, yet I'm getting tons of flipping (gimble lock.) I've tried converting the animation to use quaternions, but no such luck. Here's the code I'm using for the animation: If anyone can offer a solution to stop the constant flipping, I would be grateful. Every method I know doesn't want to work on this path. Thanks, DB
  4. Hey guys, I'm thinking there's a really simple answer to this, but I'm currently blanking on it. Basically, I'm trying to position/rotate a cylinder such that it is perpendicular to a given facet. Here's the PG: https://www.babylonjs-playground.com/#U8ZVF8 It looks like it works for facets on part of the sphere (maybe?), but there's clearly something I'm missing. Thanks in advance!
  5. Hi, I am not able to get the normals on an extruded surface right. In this playground http://www.babylonjs-playground.com/#53YWDR try clicking on the extruded shape. The normals on the cap are right. But the normals on the side faces are irregular. Also the reflection of light on the surface is a bit weird. Probably wrong uv. Any ideas on how to fix this? I want to have the normals and the light reflection behave like it would do on a regular cube created with Mesh.CreateBox Thanks
  6. Raghavender Mylagary

    Double sided normal's

    Hi, I have enabled double side normals for a mesh in Blender and exported it into .babylon file. When i am trying to run the .babylon file through BJS, one side of the mesh is transparent. Thanks, Raghavender Mylagary
  7. jerome

    Facet Data

    Hi Folks, I'm proud to introduce a brand new feature already integrated in the BJS core : FacetData This feature provides some methods to access and to play with mesh facets. Facets are the elementary triangles drawn by WebGL. We call them "facets" here in order to be not confused with the term "faces" : a box has 6 squared planar faces but each face is drawn with 2 facets (triangles). In bulk, you've got : mesh.updateFacetData(); // enables the feature or recompute things mesh.disableFacetData(); // disables it mesh.isFacetDataEnabled; // boolean, as it says ... mesh.facetNb; // number of facets mesh.getFacetPosition(i); // gives the world position of the i-th facet mesh.getFacetNormal(i); // gives the world normal values of the i-th facet mesh.getClosestFacetAtCoordinates(x,y,z); // gives the index of the closest facet to (x,y,z) in the world // etc ... and plenty of other fun tools to play with ! Please have a read at the doc (it should be in the section "Advanced Tutorials" of the doc site as soon as Monday the 23rd of January... if @RaananW accepts my bribes) and at the provided PG examples. For those who cares, all the facet indexes here are the same than the ones used by the object PickingInfo or the pickable SPS, called there faceId. So you can easily mix all these different features. Example : to get the normal of the facet from a picked point on a mesh. Have fun
  8. jschatz1

    Cannot read property 'normal' of null

    First off BabylonJS is awesome! I am having a problem with CSG currently. This error I get only seems to happen on Chrome on Windows. Edge on Windows and all Mac works fine. I have an app that is creating CSG on the fly. This is for a foam case building app that I am working on. For a gun shape that has two circles for finger notches as seen in the 2d image below. You can also see in the image below the points of the polygon I am rendering. We've added two circles to the render as well. When I run this as a `CSG subtract` in BabylonJS on Chrome on Windows for certain shapes, with an example below. I get the following error: Uncaught TypeError: Cannot read property 'normal' of null at Plane.splitPolygon (eval at globalEval (app.js:1), <anonymous>:48668:68) at Node.build (eval at globalEval (app.js:1), <anonymous>:48826:28) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) at Node.build (eval at globalEval (app.js:1), <anonymous>:48836:27) This error is a little bit beyond my understanding of Babylon. I don't think that I have any complex lines where the lines are over lapping one another and I also don't know how to catch this error. Would be great to be able to catch the error if we can't fix it. Again thanks for the great library.
  9. I've read the code written by the awesome @Temechon, which addresses modifying the vertices in a mesh. However, I don't understand exactly how to create one such mesh from scratch, especially in such a way that it can be updated frequently with new vertex data. Could someone explain that more clearly? (Also, does BabylonJS have a way to use a VBO for such a task?) I'd post example code, but I don't really have anything that even begins to work yet. EDIT: Clarification. I know the logic and steps needed to create a mesh using vertices and the like. What I don't know is how one applies the arrays to the mesh itself, or how to create the mesh so the vertices can be updated.
  10. Hi, I have an .obj file that has bad normals. It's exported from 3ds max a long time ago and z is up and y is forward (XZY) instead of XYZ which causes huge issues for my lighting. Related topic I think made a long time ago: http://forums.cgsociety.org/archive/index.php?t-305628.html So I'm wondering if there's anything I can do with babylon to try and fix this? Unity for example has "calculate Normals" (Normals & Tangets -> Normals -> calculate) that solves it. Importing & Exporting and disable "autosmooth" in blender also worked. Three.js auto-solved it when importing the obj. I tried the BABYLON.VertexData.ComputeNormals and it did not solve it for me. I did solve it myself by rotating the normals with this: var rotationQuat = BABYLON.Quaternion.RotationYawPitchRoll(0, Math.PI * 1.5, 0); So for the question again is there any way that I could have used babylon's existing API to solve the bad normals? Here's a playground with the model and a directional light: http://www.babylonjs-playground.com/#1S9WC2#3 Here's an imgur picture I took of my project using a shadermaterial rendering the normal values: http://imgur.com/a/466NV As you can see in the picture "up" is positive Z and forward is positive Y which is why the directional light does not work.
  11. Quick question, I am about to test it but I am working on some other stuff for the next hour or so and before I get to this problem I figured I would ask the community. I have a Theory that if I use: updateMeshPositions(positionFunction, computeNormals) and in the function just tell it that positions = positions or even skip that step and literally, just call the function with the flag computeNormals if it will update the normal data on the mesh? I kinda doubt it because I am assuming that the new normal data come from the manipulation of the Vertices in the function itself as it propagates. Is there a way to push the results of a VertexData manipulation to also update the Normals, I know its not inherent because I have logged the response after manipulation and it is the same as before. ***EDIT AND UPDATE*** Yea I guess it does work... after you manipulate the vertexData just pass the mesh through Mesh.updateMeshPositions(function(){}, true); and you will update the normals...
  12. babycarlitos

    avoid presents!

    Hello everyone! I have been enjoying doing some interesting stuff with pixi. Then I decided to check V3 and was able to change all my projects to the new version. So far so good. Now I see on the site this nice sample http://www.goodboydigital.com/pixijs/pixilights/ I have been trying to mimic the "shadow" that the light does to the presents to no avail. I have checked the examples at http://www.pixijs.com/examples/ but none have this particular feature. I did see the lights example that it is still experimental using the PIXI.lights.WebGLDeferredRendererer(W,H) but that does not give me the shadows to objects and it also separates my objects into two groups: with normals and without normals breaking my z order so I guess my 2 questions would be: 1 - how can I achieve that shadow ( I looked at the presents code and it is obfuscated using require.js , was able to read some, but it will take a while to be able to make sense of it ) 2- Is it possible to have the z order intact using PIXI.lights.WebGLDeferredRendererer ? Thanks for your help!
  13. Hello fellow BabylonJS users, I'm currently using babylon to put some product visualizations on the web, but today I ran into a problem that I didn't find to be documented anywhere. I got a poly-reduced CAD-data rip with custom vertex normals, in Blender everything looks nice and smooth, but when I export to babylon, all those data seemsto be lost. Do you have any idea how to fix this? I'll attach an image, showing the dataloss. Have a nice day, J
  14. Hi, I'm not sure what exactly is the issue here but, i have a mesh which is exported from Max with a simple material with jpg in diffuse and a b+w jpg in the opacity slot. For some reason this is rendering in Babylon almost as if the normals are inverted, or maybe as if there is some z-sorting issue going on ( ie the object is not transparent, but where parts of the object visually overlap itself on screen there seems to be transparency, hence why i'm thinking maybe z issues ).. The alpha itself seems to be working as expected, and the material inside babylon appears to be set up correctly with the jpg showing up as the materials 'opacityTexture' etc.. Any clues what's going on? I've tried checking mesh normals inside Max etc everything is fine :/
  15. A few days back, dad72 posted a little piece of useful code for attaching an object to a specific bone. So I thought I would try it out. Sword It works, in the sense that I can add/ remove the "sword" (just a long thin cube) to a hand bone. BUT ... Try this: 1. Check out the sword without clicking on it - appears like a normal elongated cube. 2. Click on the sword - it attaches to the hand - but examine the sword now (without clicking on it) and the normals seem to be flipped. 3. Click on the sword - it detaches from the hand and returns to its original position - and the normals are back as they should be. Anybody, any idea what is going on? (Everything comes from Blender, I made sure that the normals are facing outside before exporting.) cheers, gryff
  16. Hello everybody. I think I got myself into a trap. In our configurator, you start planning in 2D space. Where X is from left to right and Y from top to bottom. Then you can switch and see the 3D view of your planning. Now as I have forgotten or just suppressed it, is that babylon handles some directions differently. Now X is mirrored. I tried to but an invisible box as a parent and then set scaling.x to -1. Unfortunately then everything is illuminated wrong, therefore I tried to flip the normals too, but that didn't help neither. What would be the best way? Please keep in mind that there is no model that could be exported with another parameter for the left or right handed thing. Please look at the screenshot below for more clearity. Thanks!
  17. Bigus

    Ab-normals

    HI All I'm a 3D and Babylon newbie and am struggling with normals. I understand the concept of them (I think) and that in Babylon terms a normal is defined for each vertex, but I don't know what values to use to define those normals or how to calculate them. Here is what I've been working on (a way of extruding an object from a 2d face): http://jsbin.com/noquwehujudi/1/edit The object is meant to be like a rectangular box with a rebate cut out of it and each "face" of that object is composed of 2 polygons but only one of which is "facing" the right way. I basically set all the normals to 1 _ I don't know what that 1 means, it's just a value used in one of the playground demos. I don't understand why some polygons are facing the right way (outwards) and some are facing inwards. Could someone tell me what I should be doing, in not too mathematical terms? Thanks Bigus
  18. It seems like my normals are all messed up. They look correct in 3DS Max. Was easy to fix in Blender, but I can't figure out what is wrong in 3DS. I'm pretty sure it's the normals, but I can't be certain especially since they appear correctly in the 3DS Max editor. The hidden rider... lol He only appears when the base he stands on is out of the frame.... very strange. Any suggestion? Item in 3DS Max