Arch: allow to set a custom camera position in webgl export
This commit is contained in:
parent
710882d2a4
commit
ccde13acd9
|
@ -37,6 +37,7 @@ else:
|
||||||
|
|
||||||
tab = " " # the tab size
|
tab = " " # the tab size
|
||||||
wireframeStyle = "faceloop" # this can be "faceloop", "multimaterial" or None
|
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>
|
template = """<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -129,7 +130,9 @@ def getCameraData():
|
||||||
"returns the position and direction of the camera as three.js snippet"
|
"returns the position and direction of the camera as three.js snippet"
|
||||||
|
|
||||||
result = ""
|
result = ""
|
||||||
if FreeCADGui:
|
if cameraPosition:
|
||||||
|
result += "camera.position.set("+str(cameraPosition[0])+","+str(cameraPosition[1])+","+str(cameraPosition[2])+");\n"
|
||||||
|
elif FreeCADGui:
|
||||||
# getting camera position
|
# getting camera position
|
||||||
pos = FreeCADGui.ActiveDocument.ActiveView.viewPosition().Base
|
pos = FreeCADGui.ActiveDocument.ActiveView.viewPosition().Base
|
||||||
result += "camera.position.set( "
|
result += "camera.position.set( "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user