Jump to content
Developer Wiki and Function Reference Links ×

Set Views in Vectorscript


Recommended Posts

Hi All,

Just a quick vectorscript question, I am creating a plug-in which uses various sweeps and Move3D commands, to make the geometry perform correctly at the start of the script I have to reset the view and orientation using:

SetView(#0d,#0d,#0d,0,0,0);

however this is irritating for the end user, it there a way to copy the current view then set the view as (#0d,#0d,#0d,0,0,0) then at the end of the script return the back to the original view...

Cheers,

Josh

Link to comment

Maarten

Yeah I looked in to extruding along a nurbs path but found that the geometry doesn't load untill the end which meant that I couldn't add or subtract other objects with the extrude...

I just want to revert the view back to the start such that the end user doesn't need go back to their previous view once they change the plug-in...

cheerrs Josh

Link to comment

It turns out that switching to SetView(0,0,0,0,0,0) then reverting back to the original view point works however it then messed up some of the geometry in the plug-in, especially geometry which is Duplicated and moved...

Has anyone had experience with this and how to fix it?

Edited by joshtreverton
Link to comment

Setting the view to top is generally still needed for path-related functions.

There are a few things you can do to speed things up.

Get the view: GetView(xAngleR,yAngleR,zAngleR, offsetX,offsetY,offsetZ);

Check the view first: If xAngleR,yAngleR,zAngleR are all 0 then don't change the view. You should also check the the projection GetProjection()

IF (Projection <> 6) & ((xAngleR<> 0) | (yAngleR<> 0) | (zAngleR<> 0)) THEN SetView()

You can also use SetPref(9873,TRUE) to prevent a screen redraw when the view is changed but then you MUST call SetPref(9873,FALSE) after you set the view back. You will see the largest speed increase in a 3D view from this.

Link to comment

Just adding a few thoughts:

1) Once I understood the orientation in which Sweeps are created within the PIO environment, I've never had view issues with them. I create the given Sweep and then use Set3DRot and Move3DObj to orient it and move it to where I want it.

2) Currently, the only two places in any of my PIOs in which I'm having to change the view are when I'm dealing with 3D arcs for ExtrudeAlongPath operations or when I'm dealing with Texture mapping on Meshes. Then, like Josh, I use GetView, GetRenderMode, and GetProjection to make the process invisible to the user.

3) I've found ExtrudeAlongPath to be very useful but I found 2 things to be a little confusing:

a) Creating EAP objects based on non-level NURBS paths can result in some odd "twisting" of the profile.

b) The EAP object is actually 3 objects - the extrude face and the 2 endcaps. So, if you create an EAP object and apply a texture to the LNewObj you'll only be grabbing the last endcap.

4) I can't recall having any 3D adding/subtracting issues and I know I've got both going on.

5) Miguel is right about making sure you're using Move3DObj instead of HMove. I do have 1 PIO in which using 1 or the other is view-dependant, but that is easy enough to trap.

I hope something in there is helpful to you...

Link to comment

Thanks for your responses guys,

I have used the SetProjection as you guys recommended, and have used Move3DObj instead of HMove, which made a small improovement...

However I have realised what was causing my problems:

Firstly, the hDuplicate function works in 2D not 3D so that is probably causing problems...

Secondly, The geometry is distorted when I have been duplicating an object then flipping it around a Locus, i.e.

Move3DObj(RHSarchitrave3D, ((PW/2)+SideJambThk), 0, 0);

LHSarchitrave3D := HDuplicate(RHSarchitrave3D,0,0);

DSelectAll;

SetSelect (LHSarchitrave3D);

Locus (0,0);

locHdl:= LNewObj;

FlipHor;

DelObject(locHdl);

does anyone know of a way around this? I am creating a PIO with curved geometry so it flipping around a Locus really is the only way that I can do some of the things that I want to do...

Edited by joshtreverton
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...