< Back to IRCAM Forum

3D wine glass looking weird

Hello!

I am trying to build a resonating wine glass in Modalys.
I have built my 3 separate elements (the top part, the middle tube and the lower part of the glass).
I’m now trying to assemble them and I’m facing “some” issues: the lower part doesn’t appear, the tube is huge and the top part of the glass is facing the wrong way:

Could you please help me figure out the parameters I need to work on? Not fix the whole script, I’ll work on it, but I can’t find out what to change to assemble everything nicely and changing randomly the parameters isn’t getting me anywhere I want :face_with_thermometer:

Thank you!

Here is my bit of script:

; init
(new)
(set-sample-rate 48000)

; scaling variable
(setf scale 1)

; building the glass wine parts
(setf partie_haute (make-mesh 'single-point (vector 0 0 0 )))
(duplicate 'translation partie_haute 1 (vector 1 0 1))
(duplicate 'rotation partie_haute 7 (vector 0 1 0) (list 0 0 (* scale 1)) 15)
(duplicate 'rotation partie_haute 36 (vector 0 0 1) (list 0 0 0) 10)

(setf partie_tube (make-mesh 'single-point (vector 0 (* scale 0.01) 0 )))
(duplicate 'translation partie_tube 1 (vector 0 (* scale 0.1) 0))
(duplicate 'rotation partie_tube 18 (vector 1 0 0) (list 0 0 0) 20)
(duplicate 'translation partie_tube 12 (vector (* scale 1) 0 0))

(setf partie_basse (make-mesh 'single-point (vector 0 (* scale 13) 0)))
(duplicate 'translation partie_basse 5 (vector 0 0 0))

; glue the parts
(setf wine_glass (make-mesh 'add (list partie_haute partie_tube partie_basse)))
(duplicate 'rotation wine_glass 36 (vector 1 0 1) (vector 0 0 0) 10)
(duplicate 'homothety wine_glass 1 (list 0 0 (* scale 3)) 1.02)

; mesh visualization
;(view 'mesh wine_glass)

Hi Make-wesh,

I think it was because of the basse has only one dimension, but the other parts have 3 dimensions, so it could not be displayed.
Here is a version with tiny modifications.

(in-package :mlys)
(new)
(set-sample-rate 48000)

; scaling variable
(setf scale 1)

; building the glass wine parts
(setf partie_haute (make-mesh 'single-point (vector 0 0 0 )))
(duplicate 'translation partie_haute 1 (vector 1 0 1))
(duplicate 'rotation partie_haute 7 (vector 0 1 0) (list 0 0 (* scale 1)) 15)
(duplicate 'rotation partie_haute 36 (vector 0 0 1) (list 0 0 0) 10)

(setf partie_tube (make-mesh 'single-point (vector 0 (* scale 0.01) 0 )))
(duplicate 'translation partie_tube 1 (vector 0 (* scale 0.1) 0))
(duplicate 'rotation partie_tube 18 (vector 0 0 1) (list 0 0 0) 20)
(duplicate 'translation partie_tube 4 (vector 0 0 (* scale -0.5)))

(setf partie_basse (make-mesh 'single-point (vector 0 0 (* scale -2))))
(duplicate 'translation partie_basse 5 (vector 0 0.15 0))
(duplicate 'rotation partie_basse 18 (vector 0 0 1) (list 0 0 0) 20)
(duplicate 'translation partie_basse 1 (vector 0 0 -0.1))

; glue the parts
(setf wine_glass (make-mesh 'add (list partie_haute partie_tube partie_basse)))

; mesh visualization
;(view 'mesh partie_tube)
(view 'mesh wine_glass)

Best,
Jialin

1 Like

Hello Jialin,

Thank you very much for your help. My wine glass is now looking so much better. I understood the modifications that you suggested. I will work on my proportions and dimensions in the future!

Thank you again!
C

1 Like