Set the initial point of the viewer

Hi! i wonder if there is some mode to open a file and set the viewer to begin the “virtual tour” on a determinated place of the model. In other words, is there a way to avoid the part of having the model in the warehouse and then jump into it? For example if its a closed model, lets say a box for example, and i want to get in but it has no doors.

Hi! It is actually possible, but there is no UI so far. You need to set a Sketchup attribute on the model. This can be done e.g. with the Sketchup extension “Attribute editor” by Eneroth. In this extension’s menu, pick “Current model”; then add a dictionary called “Baroque_VRSketch_scene”; add a value called “initial_scale”, set it to 1 (to get a 1-for-1 scale initially); then add another value called “initial_position”, choose “Point/Vector from model”, click inside the model on the floor where you want the initial position to be, and choose “No” to the “Convert to array?” question. This model will open at that point. It should also work if the model is then uploaded as a cloud model and opened from there.

We’re thinking about adding a UI to do the same thing.

Worked amazingly, though i think i made something wrong, because it positioned me in the “origin” of axis, (0,0,0), what am i doing wrong?

Senza titolo

Oops, looks like there is a small mistake in the code setting up the initial position. It expects a vector, and not a point. You need to re-open the “initial_position” value, and change manually the text “Geom::Point3d.new” into “Geom::Vector3d.new”. That’s a bug, but not too deep.

(Or equivalently, click the “Point/Vector” button but then draw a vector starting at the origin 0,0,0 and going up to the point you want)

Sorry for the delay in my answer! So far its working, i still dont know yet how to rotate the initial point but i solved it just rotating the model, thanks!

Good to hear! There is no support for rotating the initial point; I’ll keep that in mind if and when we implement a regular user interface to do that.

2 Likes

This works great! It would be fantastic to implement a UI version. :slight_smile:

But wouldn’t it be simpler to just add a dropdown in the config to select the starting scene? Position and orientation are already built into the scene function. The only thing missing is defining a scale, which could be a text prompt.

In the “configure vr” window the default could be:
Starting scene: Warehouse :arrow_down:
Starting scale: [ 1:50]

@MrTeeF Hi! Yes, it actually looks like a good idea. We could just add a scene in the model, and mark it as “use that scene initially when loading the model”.

For setting a scale, maybe that could just be an extra value we store on the scenes when created from VR. In other words, save the current scale when we make the scene, and restore it afterwards.

But note that scenes may have a few caveats: e.g. I’m not sure you can (so far) define a scene that sends the VR player with his feet exactly on the ground. I’d need to check that.

1 Like

True but i don’t think that’s much of an issue. Up to the user to place the camera relatively correctly. And if we want it to be a flying overview scene then thats ok to.

But of course it would be cool to have a gravity option… Let the user fall till they hit the ground. :joy:
JK…but in all seriousness that could work…

I’ll check what we can do. Note that for now, you can just click “send to VR” and immediately afterwards activate the scene in Sketchup (double-clicking on it in the list of scenes). Doing so should activate the same scene in VR, just always at the scale 1:1.