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.

Dark GDK / dbPointLimb equivalent converted to DarkGDK - problems

Author
Message
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 12th Dec 2010 13:32 Edited at: 12th Dec 2010 13:33
Hey,

This is my code, i am trying to point a certain limb to a certain position:

This is the mathematical part of the code coverted from someone (sorry can't remember) dbp's source.



After this I do the folowing:



Where the ntom variable is an object, and where PointLimb is from the mathematical part.

Well basicaly the neck of the player really does not point to the desired position.

Is there some other way, or something in my code?

Thanks in advanced,

RedEye

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 13th Dec 2010 11:10 Edited at: 13th Dec 2010 11:12
I've got a piece of code here that works like the 'point' command.
I have only tried it on objects though, not limbs. Its alot simpler than what you have but it only works if there is no 'roll' involved, in other words, your limb rotation about the z-axis has to be 0.



You use like this:


Not guarenteed to work with limbs but thought it was worth a try.
The original equation was taken from the GDK.NET forum in a post by Sven B. I just altered it slightly and swapped it around.


It works as you only need two rotations to point to any point in space with the drawback that 'roll' is not a consideration.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 13th Dec 2010 19:10
Thanks for the help, and nice code you got there!

Quote: "It works as you only need two rotations to point to any point in space with the drawback that 'roll' is not a consideration."


Yeah, what I am trying to do is that the point that a head limb of a character points at is the 3d coordinates calculated by the 2d x y coordinates of the mouse. Wich could involve x,y, and z rotations.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 13th Dec 2010 19:44 Edited at: 13th Dec 2010 21:55
Yeah, it will point at any point in 3D space, thats not a problem.

The problem would be if you want his head to rotate about the z-axis, which should not be a problem most of the time as long as the character is upright.

If it works with limbs then he will be able to look up and down and left and right, as long as he does not tilt his head towards his shoulders then it should be fine.

I may give it a go later if I get time.

EDIT: No, can't get it to work, it works for certain quadrants, there may be something wrong with the formula, I may try again tomorrow.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 14th Dec 2010 10:25
the qMaths.h wich is the first code, has PointLimb included.
That works, but it is pointing at the wrong xyz coordinates.

I might have calculated the mouse xy to 3D xyz wrong. But yet again, the FPSC limbs are pretty wierd setted up.

I hope somone lit this up...

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 14th Dec 2010 18:20
Yeah, the FPSC models are set up different, I would try your code on one of the models you get with GDK, if you get that to work then you know its not your code thats wrong.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 14th Dec 2010 20:52 Edited at: 14th Dec 2010 21:19
Yeah I tried on it, and it works!
Iam happy to know that my code works altough i used this for accurate 3d coordinates:



I am happy to know that my converted code works! But now how would I fix this in normal FPSC characters? Next challange i guess...

Edit: Code fix!

EDIT2: I found that the fpsc characters(havnt tried this on all of them tho) got their axis inverted, x = y and y = x XD! (=only individual limbs) Dont ask me why. Anyway, so i am gonna experiment with that, and see what i can come up with.

Thanks for you help so far matty btw!

EDit3: Error.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 14th Dec 2010 21:07
Quote: "But now how would I fix this in normal FPSC characters? Next challange i guess..."


Let me know if you find a solution for FPSC characters as I have been looking for a solution also for the last couple of weeks.
A got Milk Shape free for a month and it seems the Dark Matter characters have 'groups', each limb being a group, while the FPSC have only one or two groups with the whole mesh in.

I'm not a modeler so I'm not really sure how difficult it will be to split the FPSC characters into groups.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 14th Dec 2010 21:18
Haah just edited my previous post. Here is a screen:

If you dont understand, please say so i can eplain or make a video.



Login to post a reply

Server time is: 2024-09-28 14:11:21
Your offset time is: 2024-09-28 14:11:21