0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

windows11で、sketchup6 その56

Posted at

概要

windows11に、sketchup6を入れてみた。
rubyで、3Dを書く。
練習問題、やってみた。

練習問題

rubyスクリプトでカメラを動かせ。

写真

image.png

サンプルコード

def testcam3
	view = Sketchup.active_model.active_view
	camera = view.camera
	eye = camera.eye
	vx = eye.x.to_cm
	vy = eye.y.to_cm
	vz = eye.z.to_cm
	target = camera.target
	prompts = ["Position X", "Position Y", "Position Z"]
	values = [vx, vy, vz]
	results = UI.inputbox( prompts, values, "Camera")
	if results
		vx, vy, vz = results
	else
		UI.messagebox "dame"
		return
	end
	eye.x = vx.cm
	eye.y = vy.cm
	eye.z = vz.cm
	up = camera.up
	camera.set eye, target, up
	UI.messagebox "ok"
end

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?