2023-12-13 10:29 AM - last edited on 2024-09-26 01:32 PM by Doreena Deng
Hello everyone
I am making a GDL based camera with changeable geometry, projection, ect.
I have 2 variables hr & vr (Horizontal rotation & Vertical rotation)
and I want moving hotspots to be set in the same position.
Can you please tell me what am I doing wrong?
I know that you can do that kind of thing in 2d for text for "free movement" witch I have done, is it even possible to do that kind of thing for angle, if no I was trying to set hotspots in the same plane like hr is (0,1,0) and vr is (0,2,0) But I am having troubles with planes of rotation for example (vr) needs to be on my vatical plane and hr on horizontal, but horizontal in on vertical plane...
here is my chuck of code for rotation:
add 0,-bcmd1/2,-bcmd1/2
block bcml1,bcmd1,bcmd1
del 1
add bcml1,-bcmd2/2,-bcmd2/2
block bcml2,bcmd2,bcmd2
del 1
addx bcml
! ------------------------------------------------------------------------------
! HOTSPOTS
! ------------------------------------------------------------------------------
unID=0
!--- BASE HOTSPOTS ---!
hotspot bcrhl+bcol,0,0,unID,vr,4+128,vr :unID=unID+1 !BASE FOR VR
hotspot bcrhl+bcol,0,0,unID,hr,4,hr :unID=unID+1 !BASE FOR HR
rotz hr
roty vr
!--- Vertical rotation (vr) ---!
hotspot bcrhl,0,0,unID,vr,5,vr :unID=unID+1 !MOVEING
hotspot 0,0,0,unID,vr,6,vr :unID=unID+1 !CENTAR
hotspot bcrhl+bcol,bch,0,unID,vr,7,vr :unID=unID+1 !REFERENCE
!--- Horizontal rotation (hr) ---!
hotspot bcrhl,0,0,unID,hr,5,hr :unID=unID+1 !MOVEING
hotspot 0,0,0,unID,hr,6,hr :unID=unID+1 !CENTAR
hotspot 0,bcrhl+bcol,0,unID,hr,7,hr :unID=unID+1 !REFERENCE
add -bcbd/2,-bcbd/2,-bcbd/2
block bcrhl+bcbd/2,bcbd,bcbd
del 1
add bcrhl,-bcw/2,-bch/2
block bcl,bcw,bch
del 4
Thank you in advance!
Solved! Go to Solution.
2023-12-14 03:12 AM - edited 2023-12-14 03:16 AM
Wrong type of hotspot? Angle Hotspots should have 4 nodes. Center, moving, base, reference. Ideally, they would also include a Cosine function to keep the hotspots position consistant relative to the inputted rotation.
From one of my objects:
hotspot ProWidth / 2, 0, 0, unID, ProPitch, 6 :unID = unID + 1 !Bottom Left center
hotspot ProWidth / 2, 0, ProLength, unID, ProPitch, 5 :unID = unID + 1 !moving
hotspot ProWidth / 2, 0 - ProLength * sin (phi), ProLength - (2 * ProLength * sin (phi / 2)) * cos ((180-phi)/2), unID, ProPitch, 4+128 :unID = unID + 1 !base
hotspot ProWidth / 2, 0, 0, unID, ProPitch, 7 :unID = unID + 1 !Top Right center
If you are wanting both your horizontal and vertical hotspot to overlap, you would need to include the trig functions in both your x and y parameters.
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-12-14 03:12 AM - edited 2023-12-14 03:16 AM
Wrong type of hotspot? Angle Hotspots should have 4 nodes. Center, moving, base, reference. Ideally, they would also include a Cosine function to keep the hotspots position consistant relative to the inputted rotation.
From one of my objects:
hotspot ProWidth / 2, 0, 0, unID, ProPitch, 6 :unID = unID + 1 !Bottom Left center
hotspot ProWidth / 2, 0, ProLength, unID, ProPitch, 5 :unID = unID + 1 !moving
hotspot ProWidth / 2, 0 - ProLength * sin (phi), ProLength - (2 * ProLength * sin (phi / 2)) * cos ((180-phi)/2), unID, ProPitch, 4+128 :unID = unID + 1 !base
hotspot ProWidth / 2, 0, 0, unID, ProPitch, 7 :unID = unID + 1 !Top Right center
If you are wanting both your horizontal and vertical hotspot to overlap, you would need to include the trig functions in both your x and y parameters.
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |