I am new to SceneKit and not able to get a hold of the Xcode Scene Editor. I am doing some research on iOS ARKit which was introduced recently. I created a sample project with SceneKit template. It comes with a default ship.scn.
I deleted this ship.scn and created a new SCN, drag and dropped a sample .DAE model into this SCN. I am able to view the object that I placed in .SCN file clearly with all the textures.
But when I run it in the device, the object appears on top of camera and zoomed in and not positioning properly in the camera frame.
I had to give the position of the object as x: 0, y: -60, z: -60 in Xcode Scene Editor to make it available in the center of the camera frame. But if I do this, the object will always be -60 degree from camera and I will not be able to move/resize it correctly with touch gestures.
Anyone please help me on how to make the object available at the center of camera frame such that the object also supports rotation/resize/movement etc.
I created the scene like below and added it to scene view:
let scene = SCNScene(named: "art.scnassets/Lowpoly_Notebook_2.scn")!
I have used Apple's link as reference for moving/resizing objects.
As orangenkopf quoted, My problem was with the model size. It was huge and hence didn't get rendered properly. When i change the scale of the object in Xcode Scene editor to a minimum value, i am able to view the object correctly and place it anywhere needed.
The best way is adding .dae file into the project and then Editor -> convert to SceneKit scene file format (.scn).
Related
I want to do some work with ARKit, but when I add .dae or .scn to art.scnassets group in my Xcode project, it doesn't show anything in Xcode 10.1 editor (see the picture), so I can't edit the model. Adding light or other things doesn't help.
Does anyone know how to solve it?
Suppose, you've successfully imported your dae model into Xcode's Scene graph (and this dae model doesn't have flipped poly normals) but you can't see it because your model has no texture.
Here's a simple example of ostensibly empty scene:
But this scene isn't empty. To see what it contains you need to click Show Scene Graph View button at the bottom of Xcode's UI and choose geometry's group in a list.
If you can't still see your whole dae model in Scene graph just press F on a keyboard for framing. And now you're able to assign a jpeg or png texture for your mesh via Diffuse slot of Material's properties.
In your case 3D object is called maze. Just select it, press F on your keyboard to frame your model in Scene graph and then assign a texture via Diffuse slot in Utility area (press Cmd-Alt-0 to activate a Utility area).
Scenes:
1.Splash,
one image with the IEnumerator Start() code as described below.
2.Menu,
Canvas UI with a few buttons and a some gameobjects in the scene as background. Camera has a tonemapping and depth of field script.
Stats: Batches 96, tris 20.4k, 41.5k
3.Main
Main scene of the game.
Bug, happend on android device and on pc in the editor:
1.Splash scene loads the menu scene using:
IEnumerator Start()
{
AsyncOperation async = SceneManager.LoadSceneAsync("Menu");
while (!async.isDone)
{
yield return null;
}
}
2.The canvas UI of the Menu scene appears with a black background, the gameobjects in the scene are not visible, for a few seconds.
3.The canvas UI + the scene is visible.
Same bug happens when the Menu scene is loaded from the Main scene.
Unity version = 2017.3.0f3
Using vuforia in the main scene.
EDIT:
I disabled all the objects and camera effects in the Menu scene except for a plane and the canvas, the canvas still appears a few seconds before the plane.
To describe the bug better, the camera seems to active a second after the canvas UI is shown.
EDIT2:
I created a new camera in the menu scene and the problem still persists.
I found my fix by adding an AR camera to the scene and disabling the the VuforiaBehavior component which was making the black screen when the scene was loading.
In my case, I just had checked Split Application Binary in Publishing settings to be able to upload my game to Play Store. (Play Store does not accept apk files to be bigger than 100mb, so you split your big apk into a smaller apk & a obb file)
However, if you do that, you need to put both your .apk and .obb files to specific folders in your phone, when you are manually testing the game.
.obb needs to be in a specifically named folder, with a specific name, as explained here: http://graphicdna.blogspot.com/2017/06/manually-copying-unitys-apk-and-obb.html
Shortly, name should be in the format:
main.[FIRST_PART_OF_VERSION_NUMBER].[PACKAGE_NAME].obb
Where [FIRST_PART_OF_VERSION_NUMBER] is the highest digit of the version number you can find in the Player Settings. For instance, if your version is 1.0.0, [FIRST_PART_OF_VERSION_NUMBER] is 1.
And [PACKAGE_NAME] is the package name specified in the same screen, right above the version number.
The game will expect to find that OBB file in a location like:
[INSTALL_LOCATION]\Android\obb\[PACKAGE_NAME]
Where [PACKAGE_NAME] is the same value described above, and INSTALL_LOCATION refers to whether the game is installed in the internal memory or the external SD-Card (this depends on your own settings).
↪️ I want to embed a street view in app so I created a new Project
↪️ Added Street View To Skybox from the asset store
↪️ Imorted a street view from google maps to a Skybox
↪️ Drag and droped the sky box in the scene
↪️ how I do move the camera in response to the touch and mouse moment like a panorama in this example
↪️
1.Unit 3d documentation
2.Unity Touch Swipe Camera Rotation - Touch FPS Controller
3.Street View Convert
4.Street view converter unity 3D panorama
5.Unity3D Tutorial: How to make Skybox 360 single texture
I'd do the following:
Create an empty GameObject called "RotorY" which will be responsible for y rotation of your camera (looking around).
Create an empty GameObject "RotorX" as a child of "RotorY". This one will control x rotation (looking up and down)
Make camera a child of RotorX. (also make sure RotorX and Camera have (0,0,0) position in local space)
Add this script to any gameObject and assign rotorY and rotorX to the slots (while experimenting I ended up writing this script, lol)
EDIT January, 2017: added 2 lines in the code to make it work with unity 5.5
I'm testing a custom scene in ThreeJS.org/editor. I've started with the Camera example scene as a template. I want to add custom geometry to it. When I import my OBJ file, the mesh appears in the editor with no problem, but there doesn't seem to be a way to import its material along with it. Instead, I went and manually assigned the correct texture map to the imported object's Material component.
In the editor, the texture map showed up and looked great after I added it manually, but when I pressed Play (or when I Exported or Published the scene) the texture map for that object was gone again. I tried refreshing my window, and all changes I made to the material component were lost.
There must be something simple I've overlooked. Can anyone help?
The OBJ format doesn't store material data; it uses a separate format, MTL, for that. Unfortunately, it seems that the Three.JS editor doesn't currently support MTL files.
I am trying to achieve an effect similar to one of the cardboard app examples that Google has put out with their cardboard app called the 'exhibit'. I have a 3D object that I want to rotate using device orientation control. Right now with just the device orientation control, I can view the 3D object but when I turn around, the camera rotates (it seems) causing the object to fall out of view until I turn all the way back around to where it was in the beginning. In other words the camera seems to rotate in its axis as I look around. What I want is to be able to rotate the object as I turn around.
Kinda like this example http://threejs.org/examples/#misc_controls_orbit except I want to rotate using device orientation control.
Any idea how I can incorporate this feature?
Thank you for your assistance.
The answer to my own question for future seekers is to replace camera in
controls = new THREE.DeviceOrientationControls(camera, true);
with the 3D object you are trying to rotate.