GDL-Object always looking to camera
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 09:05 AM
‎2006-05-25
09:05 AM
I want my (Bitmap)GDL-object always to look into the camera. I know I can Use GLOB_EYEPOS_X or _Y or _Z. But how do I do that? I don't find it in the manual...
thanks a lot
Macangelo
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 11:04 AM
‎2006-05-25
11:04 AM
I don't have the code by the hand, but you should find it in the gdl cookbook or by search in this forum.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 06:24 PM
‎2006-05-25
06:24 PM
macangelo wrote:Macangelo,
Hi,
I want my (Bitmap)GDL-object always to look into the camera. I know I can Use GLOB_EYEPOS_X or _Y or _Z. But how do I do that? I don't find it in the manual...
thanks a lot
Macangelo
Here's part of one of my scripts that rotate. I developed it so long ago, I don't really remember how to explain it...I think I go the concept from DNC.
anyway, here it is:
dkx=K~-X~:if dkx=0 then dkx=1
dly=L~-Y~:if dly=0 then dly=1
dazi=ATN(dly/dkx)
if (dazi+90) >90 then rotz 180
if (dazi+90) <90 then rotz 0
HTH,
dan K
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 08:00 PM
‎2006-05-25
08:00 PM
Hi Dan,
Thanks for your try.
I copied and pasted your code and get the error message:
"Die Verwendung von realen Typen kann zu Präzisionsproblemen führen." meaning something like "The usage of real types can lead to precision problems." or something😉
I replaced K~ with GLOB_EYEPOS_X and L~ with GLOB_EYEPOS_Y - same result.
And it does not turn my object.
Any ideas?
Thanks a lot and have wonderful day
Macangelo
Thanks for your try.
I copied and pasted your code and get the error message:
"Die Verwendung von realen Typen kann zu Präzisionsproblemen führen." meaning something like "The usage of real types can lead to precision problems." or something
I replaced K~ with GLOB_EYEPOS_X and L~ with GLOB_EYEPOS_Y - same result.
And it does not turn my object.
Any ideas?
Thanks a lot and have wonderful day
Macangelo
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 08:33 PM
‎2006-05-25
08:33 PM
macangelo wrote:You can ignore the "The usage of real types can lead to precision problems" message.
Hi Dan,
I copied and pasted your code and get the error message:
"Die Verwendung von realen Typen kann zu Präzisionsproblemen führen." meaning something like "The usage of real types can lead to precision problems." or something😉
I replaced K~ with GLOB_EYEPOS_X and L~ with GLOB_EYEPOS_Y - same result.
...Macangelo
Sometimes you need to rebuild the window for the object to turn.
The older K~ and L~ global variables should still work. If you still cant get it to work post your full 3d script here for us to see and comment.
Dan K
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 08:56 PM
‎2006-05-25
08:56 PM
Macangelo,
Try this ... I know it works... just remember that you will probably need to do a "rebuild and regenerate" to see the rotation.
P.S. note that it even works correctly if the symbol is mirrored!
2d Script:
project2 2,270,1
3d Script:
dkx=K~-X~:if dkx=0 then dkx=1
dly=L~-Y~:if dly=0 then dly=1
dazi=ATN(dly/dkx)
if (dazi+90) >90 then rotz 180
if (dazi+90) <90 then rotz 0
if SYMB_MIRRORED goto 20
rotz 90+dazi-W~
goto 30
20:
rotz -90-dazi+W~
30:
ADDX -A/2
block a,1',1'
Try this ... I know it works... just remember that you will probably need to do a "rebuild and regenerate" to see the rotation.
P.S. note that it even works correctly if the symbol is mirrored!
2d Script:
project2 2,270,1
3d Script:
dkx=K~-X~:if dkx=0 then dkx=1
dly=L~-Y~:if dly=0 then dly=1
dazi=ATN(dly/dkx)
if (dazi+90) >90 then rotz 180
if (dazi+90) <90 then rotz 0
if SYMB_MIRRORED goto 20
rotz 90+dazi-W~
goto 30
20:
rotz -90-dazi+W~
30:
ADDX -A/2
block a,1',1'
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-25 09:19 PM
‎2006-05-25
09:19 PM
Hi Dan,
thanks for the offer. Here's my full code. I try your new code as soon as I'm back at my desk.
Best
Macangelo
SHADOW on
dkx=GLOB_EYEPOS_X-X~:if dkx=0 then dkx=1
dly=GLOB_EYEPOS_Y-Y~:if dly=0 then dly=1
dazi=ATN(dly/dkx)
if (dazi+90) >90 then rotz 180
if (dazi+90) <90 then rotz 0
rotx 90
B=199*ZZYZX/480
ADDX -B/2
PICTURE "PEOPLE10.TIF", B, ZZYZX, 1
thanks for the offer. Here's my full code. I try your new code as soon as I'm back at my desk.
Best
Macangelo
SHADOW on
dkx=GLOB_EYEPOS_X-X~:if dkx=0 then dkx=1
dly=GLOB_EYEPOS_Y-Y~:if dly=0 then dly=1
dazi=ATN(dly/dkx)
if (dazi+90) >90 then rotz 180
if (dazi+90) <90 then rotz 0
rotx 90
B=199*ZZYZX/480
ADDX -B/2
PICTURE "PEOPLE10.TIF", B, ZZYZX, 1
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2006-05-26 09:40 AM
‎2006-05-26
09:40 AM
Hi Dan,
Many, many thanks - it works!
Have a wonderful day
Macangelo
Many, many thanks - it works!
Have a wonderful day
Macangelo