THREE.js loading modal with model

自古美人都是妖i 提交于 2021-02-11 14:45:21
问题 What I'm currently trying to do is to load main model and then on click event display modal popup window with different model. I'm using raycaster to detect click and everything is working fine, but I'm not able to perform orbit control and raycast on the model that is displayed in the modal. raycast code part: raycaster = new THREE.Raycaster(); renderer.domElement.addEventListener( 'click', raycast, false ); function raycast ( e ) { //1. sets the mouse position with a coordinate system where

Is there a way to change the location and size of an imported .obj file in Pygame?

北慕城南 提交于 2021-01-28 03:25:54
问题 I created an .obj file using blender and loaded into Pygame using the OBJfileloader as sugested by skrx in: Error in OBJFileLoader Is there an easy way to change the location, height and width of the imported .obj file after importing it into Pygame? As an example, if you create a tree.obj file, to be able to place that same tree in different places with different sizes? Following the code below, maybe something like: object_obj = OBJ("Tree.obj", swapyz=False) object_obj.setX = 0 object_obj

Sceneform generates sfb files without colors

徘徊边缘 提交于 2020-04-30 08:47:20
问题 I have problem with the objects generated from Google Sceneform Tools ​(Beta)​ v1.13.0 in Android Studio. I downloaded the object ( .obj file ) from poly and imported to Blender to change the dimensions. After that exported again as .obj file . When I use it to generate .sfb file in Android Studio with Sceneform tools, the .sfb object that is generated is only black. Left is object ( .obj and .mtl ) imported in Blender , and right is generated .sfb file in AndroidStudio. Thanks in advance.

How to place a 3D model of type OBJ with ARKit?

风流意气都作罢 提交于 2020-01-22 15:45:10
问题 I need some help with placing a 3D model with the new apple ARKit. Is it possible to place an object of type OBJ ? I'm trying to place a 3d model of a skull. //Load the OBJ file let bundle = Bundle.main guard let url = bundle.url(forResource: "Cranial", withExtension: "obj") else { fatalError("Failed to find model file") } let asset = MDLAsset(url:url) guard let object = asset.object(at: 0) as? MDLMesh else { fatalError("Failed to get mesh from asset") } let scene = SCNScene() let nodeCranial

THREE.js - Object Picking doesnt report parent object name on object loaded with OBJMTLLoader

China☆狼群 提交于 2020-01-17 04:57:26
问题 I have loaded an OBJ file with MTL file textures using OBJMTLLoader. I copied the example from http://threejs.org/examples/webgl_loader_obj_mtl.html. The main object (man in business suit with hair, hands and shoes) displays OK with correct textures (e.g. eyes, mouth, tie, buttons). The loaded object is a THREE.Group with 10 children, each child being a THREE.Object3D which has further 3, 5 or 7 child THREE.Mesh objects. Here is the js code for loading the OBJ and MTL... //===================

Visual Studio 2012: exclude compiled file from linking

旧城冷巷雨未停 提交于 2020-01-15 03:26:12
问题 I have a simple C language project with a few files being compiled. These are compiled to .obj files and then linked together. So far so good, now I need to exclude one of these files from linking. I know this is quite unusual but this is exactly what I need: to compile a file but not link it to the project's output file. Using Visual Studio 2012. I have no idea where the linker grabs the files to link although I've been looking to various places in project properties and the vcxproj file. It

THREE.js OBJLoader - load to Geometry, manipulate, then save to BufferGeometry

匆匆过客 提交于 2020-01-12 08:48:30
问题 I'm trying establish why I can't smooth shade geometry loaded with OBJLoader. var loader = new THREE.OBJLoader(manager); loader.load('/manmodel/js/man.obj', function (object, materials) { console.log(object); console.log(materials); man = object; man.traverse(function (child) { if (child instanceof THREE.Mesh) { child.geometry.computeFaceNormals(); child.geometry.computeVertexNormals( true ); child.material = new THREE.MeshPhongMaterial({ color: 'white', shading: THREE.SmoothShading // <-----

Unresolved external in .obj files concerning FreeType library class destructors T::~T

末鹿安然 提交于 2020-01-06 16:22:57
问题 After having solved in a more or less good manner this problem : How to update a Borland 6 C++ Project from including indy.bpi to indy60.bpi? ... I now meet another difficulty : I now have "unresolved external" destuctors in .obj files : I have allready seen this error before : it seems to be a question of virtual destuctors that should be implemented with nothing : T::~T() { } ; (or = null;) The problem is that the concerned destructors are in the FreeType Library. I therefore suppose it to

how to get the absolute position of loaded .obj in three.js?

天大地大妈咪最大 提交于 2020-01-04 06:26:06
问题 loading the .obj: loader.load( 'test.obj', function ( objMesh ) { objMesh.traverse( function ( child ) { if ( child instanceof THREE.Mesh ) { child.material = mat2; } } ); I tried to find the position with mrdoobs code: objMesh.geometry.computeBoundingBox(); var boundingBox = objMesh.geometry.boundingBox; var position = new THREE.Vector3(); position.subVectors( boundingBox.max, boundingBox.min ); position.multiplyScalar( 0.5 ); position.add( boundingBox.min ); position.applyMatrix4( objMesh

Unity: Object is not being detected by raycast for highlighting

本小妞迷上赌 提交于 2020-01-02 23:14:16
问题 I followed this tutorial on object selection. However, when I import my .obj assets and try to select/highlight them, it appears that the raycaster does not pick them up. Nothing happens when my mouse clicks on my .obj object. I added the necessary colliders (box collider even mesh collider) and nothing happens. What am I doing wrong? I didn't change the code from the source provided. I just imported my object file to the scene and added the necessary physics. All I want to do is highlight my