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.

DarkBASIC Discussion / ghost a limb?

Author
Message
highwind
17
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 30th Oct 2008 18:29
hello
I'm refining the ship from the shooter game I'm working on.
It is a car with reactors instead of wheels, so I have the car that handle the main object pivot point, then I have the four reactors that works as limb and are controled by the joystick, then at last I have the four fire out of the reactors that are limbs under the reactors in the hierarchy and moves acording to the reactors.
my problem is that I whish to use alpha blending(ghost object command) in order to have the fire semi transparent, but the ghost object command apply to the whole object.

Is there a way to ghost a limb?

if not I think of this path :
1-duplicate the whole object making one plain and one ghosted and then hide the limb that are not necessary in each other
then apply the code to both object
but it seams to be a huge method for a small thing(bad for my poly counter)

2-the other method would use the "glue object to limb" command to glue the ghosted fire to the reactor, I foreseen that should be the best but I haven't already used this command so I am afraid by the time I will need to corectly set the pivot points and the fire positions before gluing and also will it be working at last

please give me your opinion

feel free to visit my web site
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Oct 2008 22:41
There's no way to ghost a limb by itself. Both of your methodswould work. Gluing the object would probably be best. But you'll have a bad time with collision for the glued object. When you glue an object, it's internal position is never updated (unless you rotate it and position it yourself). It is only rendered (drawn) where ever it is glued.

Instead of gluing the object, you can position it at the limbs. This example places two "+"(pluses) at two limb positions. The pluses are not glued and they are not limbs so therefore behave as independent objects. I haven't cleaned this example up since I posted it a month ago, but it should give you an idea of how to proceed. The objects aren't ghosted, they are just wireframe. The pluses are referred to as axis objects in the example.



Enjoy your day.
highwind
17
Years of Service
User Offline
Joined: 4th Jun 2008
Location: france
Posted: 31st Oct 2008 01:52
First i want to thank you Latch as your answer realy helps me,
also as I navigate through this forum I can see that you help many people so I want to thank you for that also.

you say
Quote: "When you glue an object, it's internal position is never updated "
I imagine that you mean it will not behave as a linked limb and will keep it's original rotation so if I rotate the reactor the fire will not move at all and if I rotate the car and rotate the reactor the fire's internal rotation will turn to a pain in my ass lol

I assume that the solution you provide us is great but unfortunately it surpass my actual competencies as I dont handle the array process but I will try to focus on it as soon as I'm on idle.

I guess I will solve my trouble by using my method 1 (the bad one).
I hope that as the unused object's limbs will be hidden they won't slow the game(except at startup) and that only the extra lines of code will.

Your intervention as helped me in a strange way because as you know logicaly I should have chosen to use method 2...

cyril

feel free to visit my web site
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 31st Oct 2008 19:52
Quote: "I imagine that you mean it will not behave as a linked limb and will keep it's original rotation so if I rotate the reactor the fire will not move at all and if I rotate the car and rotate the reactor the fire's internal rotation will turn to a pain in my ass "


No, it will move and rotate just like the limb that you glue it too so it is an ok solution. Sorry for the confusion. What I mean is, when you glue an object to the limb, if you look at what DBC returns as the position when you move the object it is glued to, the glued object's VALUES won't change but you will see it move and rotate with the other object's limb. It will LOOK/behave like the rotations and position of the limb. If you were using the internal values of it's positions and rotations for calculations, you'd run into problems.

This example shows a sphere glued to a cube's limb 0. The sphere's internal data doesn't change but it's apparent position and rotation changes with the cube.



Quote: "I assume that the solution you provide us is great "

Thanks for the compliment but it may not be so great for what you are trying to do. This may create unnecessary bulk in your program. It's just meant to get around some of the problems that can occur with gluing an object to a limb and avoiding solution one - duplicating the object. I originally would have gone with solution one so all the collision would be the same until I figured out a way around gluing. But if your limbs are the the size as the glued object, collision detection shouldn't be a problem. In fact i may not even be an issue with your program - I was just looking ahead to possibilities.

Have I completely confused you yet?

The simple version:

Gluing the object to the limb and ghosting it while hiding the limb will work. Object data for the glued object doesn't change with the limb it's glued to, though it's apparent position and rotation does.

Creating a duplicate object and hiding unecessary limbs will work also. If positioned at the same place as the original, object data will update but may hurt performance if done with lots and lots of objects or objects with very high poly counts.

Enjoy your day.

Login to post a reply

Server time is: 2025-06-07 08:23:42
Your offset time is: 2025-06-07 08:23:42