Get 3D cube from an Obb3

given an Obb3 (Center, HalfVector and axis[3]),
how can I create a cube that has the same bounds as this Obb3 ? I'll then use this cube to display my obb3 bounds.

I use vector_math and three.dart libraries
So far, my code is :

Matrix3 rot_mat = new Matrix3(node.box.axis0[0], node.box.axis1[0], node.box.axis2[0], node.box.axis0[1], node.box.axis1[1], node.box.axis2[1], node.box.axis0[2], node.box.axis1[2], node.box.axis2[2]); Vector3 diag = rot_mat.absoluteRotate(node.box.halfExtents.clone()); var geometry = new CubeGeometry(diag[0] * 2.0, diag[1] * 2.0, diag[2] * 2.0); var material = new MeshBasicMaterial(color: 0x00ff00, wireframe: true, blending: NormalBlending, side: DoubleSide, shading: FlatShading); var obj = new Mesh(geometry, material); obj.position = node.box.center; obj.matrix.setRotation(rot_mat); obj.updateMatrix(); scene.add(obj);

Thanks a lot for your help :]

Category:three.js Time:2018-11-08 Views:0

Related post

  • How to get Screen coordinates from a 3D Point? Opengl 2010-09-25

    I've seen alot of Screen-Coordinate to world coordinate posts, but have not seen the opposite. Is there an easy way of getting screen coordinates from a 3d point, from any angle I view it from? I'm using C++ and opengl --------------Solutions--------

  • stax getting atribute value from elements 2011-12-14

    I try to parse XML file from URI using STAX! XML looking something like this: <Type type_id="4218"> <Title>English Premier League</Title> <Event start_time="2011-12-18 16:10:00" ev_id="2893772"> <Description>Manchester C

  • how can i get byte-array from HBITMAP 2012-02-15

    my environment: win32 visual c++ directx i need to map another application's face to my application's texture. for example, my Internet Explorer screen is appears on my DirectX Cube's Texture, and it is updated realtime. my Method is Next: //in Direc

  • Getting UI text from external app in C# 2008-08-20

    Is it possible to get UI text from an external application in C#. In particular, is there a way to read Unicode text from a label (I assume it's a normal Windows label control) from an external Win32 app that was written by a 3rd party? The text is v

  • How do I get a value from an XML web service in C#? 2008-09-09

    In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that? For consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back <

  • Get path geometry from FlowDocument object 2008-09-15

    Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do not want to use FormattedText. Thanks. --------------Solutions------------- A FlowDocument can be viewed in any number of ways, but a Path is a fixed s

  • How do you get the response from the Request object in MooTools? 2008-09-18

    How do you access the response from the Request object in MooTools? I've been looking at the documentation and the MooTorial, but I can't seem to make any headway. Other Ajax stuff I've done with MooTools I haven't had to manipulate the response at a

  • Get position data from mobile browser 2008-09-18

    I am developing a web app that will be hit frequently by mobile browsers. I am wondering if there is a way to get enough information from the browser request to lookup position data (triangulation or GPS) Not from the request directly, of course. A c

  • Is there a way to get DateTime value from timestamp type column? 2008-10-07

    I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was imported :( Is

  • How do you get output parameters from a stored procedure in Python? 2008-10-10

    I've googled around a bit, but maybe I didn't put the correct magik incantation into the search box. Does anyone know how to get output parameters from a stored procedure in Python? I'm using pymssql to call a stored procedure, and I'm not sure of th

  • How can I get the icon from the executable file only having an instance of it's Process in C# 2008-10-15

    I can get the executable location from the process, how do I get the icon from file? Maybe use windows api LoadIcon(). I wonder if there is .NET way... --------------Solutions------------- Icon ico = Icon.ExtractAssociatedIcon(theProcess.MainModule.F

  • How to get a value from the last inserted row? 2008-10-27

    Is there some way to get a value from the last inserted row? I am inserting a row where the PK will automatically increase, and I would like to get this PK. Only the PK is guaranteed to be unique in the table. I am using Java with a JDBC and PostgreS

  • How to get a file from sourcesafe programmatically? 2008-11-13

    I need to get a file from sourcesafe database programmatically. Any idea of how to do it? ps: I'll do that by using C#. --------------Solutions------------- using System; using System.Collections.Generic; using SourceSafeTypeLib; namespace YourNamesp

  • Get the subdomain from a URL 2008-11-13

    Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the first period then return whatever came after the "http://" ... Then you remember http://super.duper.domain.example Oh. So then you think, okay, find the las

  • Get the value from one window to another window - javascript 2008-11-17

    Is it possible to get the value from first page to second page.. BUT with out FORM Shall we use window.parent.document.getElementById("").value.. But this is working in popup window, but i need this for between two pages which redirecting from first

  • "Session closed" error when trying to get a blob from DB using getBinaryStream() 2008-12-02

    I'm using Hibernate 3.1 and Oracle 10 DB. The blob is defined as @Lob @Basic @Column in the Hibernate entity which corresponds to the relevant DB table. The error -java.sql.SQLException: Closed Connection- seem to appear once in while, not in every a

  • WCF: How to get Binding object from configuration 2008-12-10

    I would like to get Binding object from web.config or app.config. So, this code works: wcfTestClient = new TestServiceClient("my_endpoint", Url + "/TestService.svc"); but I would like to do the following: Binding binding = DoSomething(); wcfTestClien

  • Can you get a DataTable from an ObjectDataSource? 2008-12-23

    If I have an ObjectDataSource defined at design time, can I get a DataTable from that ObjectDataSource at runtime? I have a method that returns a DataTable that I am using for the Select method property of the ObjectDataSource. --------------Solution

  • Can't get the object from a cell in jqGrid (jQuery) 2009-01-07

    This is the issue, when I define the ddl (drop down list or select box) I don't know the selected value. When a user edits a row, the user can select an item from the list. But the selected item isn't set. I want to set the selected item when the use

  • How to get proxy definitions from within an activeX 2009-01-19

    Ok, so here is the scenario: I have an activeX that uploads files using HttpWebRequest class. My problem is that I have to specify the network credentials in order to get the activeX to work properly behind a proxy server. Here is the code: HttpWebRe

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.202 (s). 13 q(s)