Siberia Posted November 13, 2020 Share Posted November 13, 2020 Hello ! My objective is to create geometry for meshes. until now I used quad so it wasn't too hard to model. Now I want to model some more complex shapes in 2D, polygons, cones etc. Since I'm familiar with the tools exposed in the PIXI.Graphics object, I thought to myself, "Hey! I'm going to draw a shape, and reuse the geometry contained in the Graphics object." Here is my playground: https://www.pixiplayground.com/#/edit/jGD8JtmKkkbseor6FklBg But after a few tests, it doesn't look so easy. What did I miss? Thanks for your help! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 13, 2020 Share Posted November 13, 2020 Buffer is interleaved: graphcis uses same buffer for textures, uv's and colors. If it used different ones, it could work. You can use same graphics geometry in your mesh, that should work. Btw, just in case, UV's are made for texture 16x16 by default, so you'll have to scale them. Quote Link to comment Share on other sites More sharing options...
Siberia Posted November 13, 2020 Author Share Posted November 13, 2020 Thank you Ivan! I updated the playground by putting the Graphics geometry into the mesh and I updated the vertex shader with a quick hack for the UVs. It works! But... i can't specify the width and height of the mesh. It is tied to the graphics object. Other thing, I want my graphic object to be hidden (it is just serving for primitive drawing). Putting grapher.visible = false make the mesh to not render. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 13, 2020 Share Posted November 13, 2020 if you use mesh, its mesh transform and mesh visible property that works. Read source code of Container and debug it if something is wrong Quote Link to comment Share on other sites More sharing options...
Siberia Posted November 14, 2020 Author Share Posted November 14, 2020 Thank you Ivan. By the way, is it possible to import 2D/3D models from blender, and to create a Geometry object from them? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 14, 2020 Share Posted November 14, 2020 Yes, there's https://github.com/jnsmalm/pixi3d for that Siberia 1 Quote Link to comment Share on other sites More sharing options...
Stph16 Posted February 3, 2021 Share Posted February 3, 2021 Hey, For this playground example https://www.pixiplayground.com/#/edit/jGD8JtmKkkbseor6FklBg Is it possible to generate grapher.geometry without adding grapher to the stage? In other words, I'm trying to figure out how to generate a geometry using drawing primitives (drawCircle, drawRect, lineTo) so that I could use it to create a MESH with a shader. TIA, Andrei Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.