Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Sticky 3D object

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 29th Mar 2013 17:17
I would like to be able to stick my 3D object at a particular screen co-ordinate, e.g. like the DBPro command "Lock Object On"

I won't be using any global movement on the objects, just local and scaling.

Any ideas?

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Mar 2013 17:55
You could position the object at the camera position, rotate it to suit the camera, then move it with the local movement commands - which would be in relation to the camera orientation. Once it's where you want it on the screen, rotate it locally again to the right orientation.

I've done something similar with objects attaching to other objects, and it works fine - I like those MoveObjectLocal and RotateObjectLocal commands - heck, we even have proper ball rolling type rotation now, something that DBPro would usually need a plugin for.

I could make a snippet for this, if it would help - like a lock object function that you'd call before every sync... but you might want more control over things.

I got a fever, and the only prescription, is more memes.
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 29th Mar 2013 18:10
Good idea. I'll have a go at that and see how I get on.

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 29th Mar 2013 18:58
Well, that works. For ease, I'm just trying to work out the exact distance on the Z plane so that 64px matches 64 3D units (seems to be about 700 with default FOV)
Now I need to work out what the relative X and Y units are based on the screen res and FOV

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 29th Mar 2013 22:59 Edited at: 29th Mar 2013 23:00
Maybe I could do with that example.

Everything works positionally (the settings are for 1024x768, but when I apply local rotation at the desired position, the local offset appears to be somewhere else that expected.



It's like the origin / rotation point isn't updating after the movelocal commands...

Login to post a reply

Server time is: 2024-05-06 14:31:13
Your offset time is: 2024-05-06 14:31:13