3d object bounds #185
Unanswered
andreymillion
asked this question in
Q&A
Replies: 1 comment
-
Hello and thanks! Unfortunately I don't enough time right now to make an example. There are functions to convert between 2D/3D, have a look at https://api.pixi3d.org/classes/Camera.html#screenToWorld or https://api.pixi3d.org/classes/Camera.html#worldToScreen. Another idea could be to render to a texture and then check that texture for screen x/y coords. Have a look into the folder at https://github.com/jnsmalm/pixi3d/tree/develop/src/picking which already does this for mesh interaction |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! Thanks for the library, it's really great and fast!
I'm trying to make a selection of a 3D object and highlight it by rectangular frame, like
const frame = this.getModelFrame(this.car); const graphics = new PIXI.Graphics(); graphics.lineStyle(2, 0x00ff00, 1); graphics.drawRect(frame.x, frame.y, frame.width, frame.height); Game.root.addChild(graphics);
The model can have many nested children.
I tried to get bounds, but don't know how to translate it to the 2d screen coordinates.
Maybe there is something I missing...
Beta Was this translation helpful? Give feedback.
All reactions