Commit 9adfb99e authored by Dave Cooper's avatar Dave Cooper
Browse files

billboard support for x3d

parent c5c2357f
......@@ -204,7 +204,8 @@ to the src/ directory distributed with GDL.
:objects
((base :type 'robot-base
:display-controls (merge-display-controls (list :color :blue-sky))
:display-controls (append (merge-display-controls (list :color :blue-sky))
(list :billboard t))
:height (* (the height) 0.4)
:width (* (the :width) 0.2)
:length (* (the :length) 0.2)
......@@ -223,8 +224,10 @@ to the src/ directory distributed with GDL.
(center-sphere :type 'sphere :radius 0.1)
(rob-text :type 'general-note
:display-controls (list :billboard t)
:orientation (alignment :top (the (face-normal-vector :rear)))
:strings "Bob"
:center (the center))
......
......@@ -190,10 +190,37 @@
(format nil "~3,7f ~3,7f ~3,7f ~3,7f"
(get-x rotation) (get-y rotation) (get-z rotation) (get-w rotation))))
;;
;; FLAG -- revert to proper conditional
;;
(write-the shape))
(cond ((and *onclick-function* (or (getf (the display-controls) :billboard)
(getf (the display-controls) :billboard-vector)))
(cl-who:htm
((:|Anchor| :url (format nil "javascript:~a;"
(funcall *onclick-function* self)))
((:|Billboard| :|axisOfRotation| (if (getf (the display-controls) :billboard-vector)
(let ((vector (getf (the display-controls) :billboard-vector)))
(format nil "~a, ~a, ~a" (get-x vector) (get-y vector) (get-z vector)))
(format nil "0, 0, 0")))
(write-the shape)))))
(*onclick-function*
(cl-who:htm
((:|Anchor| :url (format nil "javascript:~a;"
(funcall *onclick-function* self)))
(write-the shape))))
((or (getf (the display-controls) :billboard)
(getf (the display-controls) :billboard-vector))
(cl-who:htm
((:|Billboard| :|axisOfRotation|
(if (getf (the display-controls) :billboard-vector)
(let ((vector (getf (the display-controls) :billboard-vector)))
(format nil "~a, ~a, ~a" (get-x vector) (get-y vector) (get-z vector)))
(format nil "0, 0, 0")))
(write-the shape))))
(t (write-the shape))))
(when (and (typep self 'outline-specialization-mixin)
(not (ignore-errors (typep self (read-from-string "surf:surface"))))
......@@ -246,13 +273,36 @@
(if (null (the children))
(cond ((and *onclick-function* (or (getf (the display-controls) :billboard)
(getf (the display-controls) :billboard-vector)))
(cl-who:htm
((:|Anchor| :url (format nil "javascript:~a;"
(funcall *onclick-function* self)))
((:|Billboard| :|axisOfRotation| (if (getf (the display-controls) :billboard-vector)
(let ((vector (getf (the display-controls) :billboard-vector)))
(format nil "~a ~a ~a" (get-x vector) (get-y vector) (get-z vector)))
(format nil "0 0 0")))
(if (and (find-package :gwl) *onclick-function*)
(cl-who:htm
((:|Anchor| :url (format nil "javascript:~a;"
(funcall *onclick-function* self)))
(write-the shape)))
(write-the shape))
(write-the shape)))))
(*onclick-function*
(cl-who:htm
((:|Anchor| :url (format nil "javascript:~a;"
(funcall *onclick-function* self)))
(write-the shape))))
((or (getf (the display-controls) :billboard)
(getf (the display-controls) :billboard-vector))
(cl-who:htm
((:|Billboard| :|axisOfRotation|
(if (getf (the display-controls) :billboard-vector)
(let ((vector (getf (the display-controls) :billboard-vector)))
(format nil "~a ~a ~a" (get-x vector) (get-y vector) (get-z vector)))
(format nil "0 0 0")))
(write-the shape))))
(t (write-the shape)))
(mapc #'(lambda(child)
(write-the-object child (cad-output-tree :header? nil :from-root? nil))) (the children)))
......@@ -265,8 +315,8 @@
(let* ((center (reverse-vector (the center)))
(x (get-x center)) (y (get-y center)) (z (get-z center))
(inverse (when (the orientation*)
#+nil
(quaternion-to-rotation (matrix-to-quaternion (matrix:transpose-matrix (the orientation*))))
#+nil
(matrix-to-rotation (matrix:transpose-matrix (the orientation*))))))
(cl-who:htm
((:|Transform| :|translation| (when (not (every #'zerop (list x y z)))
......@@ -492,7 +542,7 @@
(:|Appearance| (write-the material-properties))
(format *stream* "<Text string='\"~a\"' solid='false'>
<FontStyle size='1' justify='MIDDLE'></FontStyle>
<FontStyle size='10' justify='MIDDLE'></FontStyle>
</Text>" (the %text-to-draw%))))
......
("package")
\ No newline at end of file
......@@ -4,83 +4,87 @@
:author
"Genworks and Dave Cooper unless otherwise indicated"
:license "AGPL unless otherwise indicated" :serial t
:version "2012011800" :depends-on (:lift :gdl-surf :gdl-tasty)
:components
((:file "utils/source/package")
(:file "utils/source/genworks")
(:file "utils/source/functions")
(:file "utils/source/parameters")
(:file "geom-base/source/box-matrix")
(:file "source/package") (:file "source/parameters")
(:file "source/approximated-curve")
(:file "source/arc-curve")
(:file "source/b-spline-curve")
(:file "source/b-spline-surface")
(:file "source/blended-solid")
(:file "source/boolean") (:file "source/box-solid")
(:file "source/boxed-curve")
(:file "source/boxed-surface")
(:file "source/brep-brep-solve")
(:file "source/brep-intersect")
(:file "source/compatible-curves")
(:file "source/compatible-surfaces")
(:file "source/composed-curve")
(:file "source/composed-curves")
(:file "source/cone-solid")
(:file "source/cylinder-solid")
(:file "source/decomposed-curves")
(:file "source/dropped-curve")
(:file "source/dual-blend-surface")
(:file "source/edge-blend-surface")
(:file "source/elliptical-curve")
(:file "source/extended-surface")
(:file "source/extruded-solid")
(:file "source/fitted-conic")
(:file "source/fitted-curve")
(:file "source/fitted-surface")
(:file "source/gdlxml")
(:file "source/general-dual-blend-surface")
(:file "source/general-sweep")
(:file "source/global-filleted-polyline-curves")
(:file "source/iges-reader")
(:file "source/iges-writer")
(:file "source/intersected-solid")
(:file "source/iso-curve")
(:file "source/joined-surfaces")
(:file "source/linear-curve")
(:file "source/lofted-surface")
(:file "source/merged-solid")
(:file "source/native-reader")
(:file "source/pegasus-regioned-solid")
(:file "source/planar-contour-surface")
(:file "source/planar-offset-curve")
(:file "source/planar-section-curve")
(:file "source/planar-section-curves")
(:file "source/planar-surface")
(:file "source/poly-brep")
(:file "source/projected-curve")
(:file "source/rectangular-surface")
(:file "source/regioned-solid")
(:file "source/reparameterized-curve")
(:file "source/revolved-surface")
(:file "source/revolved-surfaces")
(:file "source/ruled-surface")
(:file "source/separated-solid")
(:file "source/sewn-solid")
(:file "source/shelled-solid")
(:file "source/silhouette-curves")
(:file "source/spherical-surface")
(:file "source/split-surface")
(:file "source/step-reader")
(:file "source/step-writer")
(:file "source/stitched-solid")
(:file "source/subtracted-solid")
(:file "source/surface-knot-reduction")
(:file "source/swept-solid")
(:file "source/test-harness")
(:file "source/transformed-curve")
(:file "source/transformed-solid")
(:file "source/transformed-surface")
(:file "source/trimmed-curve")
(:file "source/trimmed-surface")
(:file "source/united-solid")))
\ No newline at end of file
:version "2012072600" :depends-on
(:lift :gdl-surf :gdl-tasty) :components
((:lisp "utils/source/package")
(:lisp "utils/source/genworks")
(:lisp "utils/source/functions")
(:lisp "utils/source/parameters")
(:lisp "assembly-output/source/package")
(:lisp "assembly-output/source/bracket")
(:lisp "geom-base/source/box-matrix")
(:lisp "source/package") (:lisp "source/parameters")
(:lisp "source/approximated-curve")
(:lisp "source/arc-curve")
(:lisp "source/b-spline-curve")
(:lisp "source/b-spline-surface")
(:lisp "source/blended-solid")
(:lisp "source/boolean") (:lisp "source/box-solid")
(:lisp "source/boxed-curve")
(:lisp "source/boxed-surface")
(:lisp "source/brep-brep-solve")
(:lisp "source/brep-intersect")
(:lisp "source/compatible-curves")
(:lisp "source/compatible-surfaces")
(:lisp "source/composed-curve")
(:lisp "source/composed-curves")
(:lisp "source/cone-solid")
(:lisp "source/cylinder-solid")
(:lisp "source/decomposed-curves")
(:lisp "source/dropped-curve")
(:lisp "source/dual-blend-surface")
(:lisp "source/edge-blend-surface")
(:lisp "source/elliptical-curve")
(:lisp "source/extended-surface")
(:lisp "source/extruded-solid")
(:lisp "source/fitted-conic")
(:lisp "source/fitted-curve")
(:lisp "source/fitted-surface")
(:lisp "source/gdlxml")
(:lisp "source/general-dual-blend-surface")
(:lisp "source/general-note")
(:lisp "source/general-sweep")
(:lisp "source/global-filleted-polyline-curves")
(:lisp "source/iges-reader")
(:lisp "source/iges-writer")
(:lisp "source/intersected-solid")
(:lisp "source/iso-curve")
(:lisp "source/joined-surfaces")
(:lisp "source/linear-curve")
(:lisp "source/lofted-surface")
(:lisp "source/merged-solid")
(:lisp "source/native-reader")
(:lisp "source/orientations")
(:lisp "source/pegasus-regioned-solid")
(:lisp "source/planar-contour-surface")
(:lisp "source/planar-offset-curve")
(:lisp "source/planar-section-curve")
(:lisp "source/planar-section-curves")
(:lisp "source/planar-surface")
(:lisp "source/poly-brep")
(:lisp "source/projected-curve")
(:lisp "source/rectangular-surface")
(:lisp "source/regioned-solid")
(:lisp "source/reparameterized-curve")
(:lisp "source/revolved-surface")
(:lisp "source/revolved-surfaces")
(:lisp "source/ruled-surface")
(:lisp "source/separated-solid")
(:lisp "source/sewn-solid")
(:lisp "source/shelled-solid")
(:lisp "source/silhouette-curves")
(:lisp "source/spherical-surface")
(:lisp "source/split-surface")
(:lisp "source/step-reader")
(:lisp "source/step-writer")
(:lisp "source/stitched-solid")
(:lisp "source/subtracted-solid")
(:lisp "source/surface-knot-reduction")
(:lisp "source/swept-solid")
(:lisp "source/test-harness")
(:lisp "source/transformed-curve")
(:lisp "source/transformed-solid")
(:lisp "source/transformed-surface")
(:lisp "source/trimmed-curve")
(:lisp "source/trimmed-surface")
(:lisp "source/united-solid")))
\ No newline at end of file
......@@ -6,17 +6,14 @@
(
(center-sphere :type 'sphere
:radius .1)
(box :type 'box :length 10 :width 10 :height 10
:display-controls (list :transparency 0.7 :color :orange))
(note :type 'general-note
:display-controls (list :color (list .32 .54 .26)
:specular-color (list 0.46 0.46 0.46)
:ambient-intensity 0.0933)
:ambient-intensity 0.0933
:billboard t)
:strings "Hey Now")
(kid :type 'general-note-kid
:center (translate (the center) :rear 10))
......@@ -30,14 +27,12 @@
((center-sphere :type 'sphere
:radius .1)
(box :type 'box :length 10 :width 10 :height 10
:display-controls (list :transparency 0.7 :color :orange))
(note :type 'general-note
:display-controls (list :color (list .32 .54 .26)
:billboard t
:specular-color (list 0.46 0.46 0.46)
:ambient-intensity 0.0933)
:strings "Hey Now")
:strings "Hey Now kid")
))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment