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 / How to Rotate an object by offset?

Author
Message
haliop
User Banned
Posted: 29th Jul 2013 23:02
cant find SetObjectOffset on the help files... so

can you help?

ty for your time.

haliop
User Banned
Posted: 29th Jul 2013 23:12
also position by offset... i wonder... what can i achieve with it..

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 29th Jul 2013 23:44
I don't use 3D much yet. I don't think you can alter the objects offset without using a 3D package. AGK's own built in object shapes automatically have central offsets, so shouldn't be a problem. Hopefully those commands will be added soon. Think I am one beta behind at the moment, so maybe they are already in!

haliop
User Banned
Posted: 29th Jul 2013 23:56
nope... and yeah i know the offset is at the center but i need it at bottom or top ... so like SetObjectOffset(1,0,sizeY/2,sizeZ/2)

so i can rotate and position it on top one another but with the ability to rotate it since... hmmm

lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 30th Jul 2013 09:53
Whenever I've needed this I created the object in Blender and set the offset there. Of course that means you can't change offset on the fly, but still.

My hovercraft is full of eels
haliop
User Banned
Posted: 30th Jul 2013 10:58
i droped it since i cant use DrawObject there is no such command... so ... and yeah i get your point that should work.

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Jul 2013 13:52
You could do it manually with the move object commands, like position and rotate, then move the object locally on the XY and Z axis. This would need an array of stored offsets, but you might have something like that in place already that you can add to.

With this technique, I can attach a particle object to anywhere on another object, and it rotates and offsets with the object, just using the move object commands.

I'm not sure that TGC will ever make the 3D offset available - because typically, we'd offset the position of a limb within the object, rather than setting an offset, we make the object center the offset, and shift everything else to suit. I'm guessing that when animation and limbs come into play, it'll be done the same way as with DBPro. Also, maybe there are some tricks with AppGameKit that mean you don't necessarily need a draw object command. Like doing manual render updates instead - like clear the screen, show the objects you want to render first, render, hide those objects and show other ones, render, then swap - so doing 2 renders to take control over things.

I got a fever, and the only prescription, is more memes.
haliop
User Banned
Posted: 30th Jul 2013 14:57
hmm interesting the problem is that with my galaxy i can get as high as 670 objects before FPS drops down... doing what you offer will suffer make the app suffer greatly cause every second i need about 3000 of them... so .. i'll pass it for now but i will test what you offer. thats a good idea. just hope the fps wont drop too much and the app wont "lag" from time to time..

Arbrakan
13
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 15th Sep 2013 01:27
Any news about SetObjectOffset ?

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 15th Sep 2013 17:38
Theres a tutorial in my thread for this. Gets around the problem.

Login to post a reply

Server time is: 2024-05-09 10:26:09
Your offset time is: 2024-05-09 10:26:09