Skip to content

Commit

Permalink
Arch: allow to set a custom camera position in webgl export
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Apr 27, 2014
1 parent 710882d commit ccde13a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Mod/Arch/importWebGL.py
Expand Up @@ -37,6 +37,7 @@

tab = " " # the tab size
wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None
cameraPosition = None # set this to a tuple to change, for ex. (0,0,0)
template = """<!DOCTYPE html>
<html>
<head>
Expand Down Expand Up @@ -129,7 +130,9 @@ def getCameraData():
"returns the position and direction of the camera as three.js snippet"

result = ""
if FreeCADGui:
if cameraPosition:
result += "camera.position.set("+str(cameraPosition[0])+","+str(cameraPosition[1])+","+str(cameraPosition[2])+");\n"
elif FreeCADGui:
# getting camera position
pos = FreeCADGui.ActiveDocument.ActiveView.viewPosition().Base
result += "camera.position.set( "
Expand Down

0 comments on commit ccde13a

Please sign in to comment.