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 Professional Discussion / Make Mesh From Object, resets Planes rotation

Author
Message
EFX
22
Years of Service
User Offline
Joined: 27th May 2004
Location: Fort Walton Beach
Posted: 4th Jun 2010 04:46 Edited at: 4th Jun 2010 04:49
Not sure if this is the same issue with planes having the default funky rotation, but I'm attempting to save a number of separate objects as one object with multiple limbs.

I create a mesh based off of each object, than add limb with each new mesh to the first object. There are only Cubes and Planes in the program at the moment, but the Planes export rotated downwards.

Here's my save function so far.



Anyone have any ideas?

On a related note, I can't seem to offset the parent limb correctly either. When I export, the first object never seems to position correctly. The code above just works around it and copies it to the next limb and that one correctly offsets. Wat up wit dat?

-
Jaeg
20
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 4th Jun 2010 05:26
I found it easier to start out with one level object, create all the meshes I need at the beginning (one plane and one cube) then when I needed to add them to the level I just added them as a limb. So when you go to place them in the program you just use the limb offset commands. It saves an extra step.

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Jun 2010 09:10 Edited at: 4th Jun 2010 09:10
If you are making meshes from objects, then they simply wont allow for rotation - what might work is just rotating limb 0 of these source objects, so the 'core' limb itself is rotated instead of the whole object which might mean it'll be frozen when converting into a mesh.

Worth a try at least.


Health, Ammo, and bacon and eggs!
EFX
22
Years of Service
User Offline
Joined: 27th May 2004
Location: Fort Walton Beach
Posted: 4th Jun 2010 12:24
Sounded like that was the problem, but rotate limb seems to have the same intrinsic problem. Looks like I might have to literally edit the vertexdata of planes to face up, or save info on which objects have been rotated and rotate just those final limbs, or have level creation on a single object like Jaeg suggests.

-
Jaeg
20
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 4th Jun 2010 16:17
Wait. You can't rotate an object turn it into a mesh and expect it to keep it's rotation? That makes no sense. In my program all of the grass and road segments are a plane mesh which started out as a plane object rotated 90 degrees then turned into a mesh. Then I reuse this one mesh for all the limbs. Or am I reading something wrong?

Go ahead. Walk into Mordor.

Ball State University - Biology Major
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th Jun 2010 16:49
Well, you might have an object that rotates a million different ways throughout the level, so it's a bad idea to save an object with rotation - because then when you load it in again, you would not rotate it, but that means you loose that information, and it means you can't clone the object because it's on it's own rotation.

It would be peachy, if adding, offsetting, and rotating a limb was permanent. I've no idea why it's not - you should be able to build your object, then converting it to a mesh should export it with no rotation, but with all the limbs fixed in their own individual rotations.

It's something I tend not to do, so I might be missing something.


Health, Ammo, and bacon and eggs!
EFX
22
Years of Service
User Offline
Joined: 27th May 2004
Location: Fort Walton Beach
Posted: 12th Jun 2010 22:17
Here's the working code for now, if anyone was curious. This doesn't take into account for objects that have normal rotation and don't need to be adjusted when converted to vertexdata. But I will fix that later.



In fact, I might just convert planes to vertexdata, then back to regular objects on creation, with the requisite rotation and normal fixes in-play at that point. Then, the save world function would never have to take these quarrelsome plane's into account.

-

Login to post a reply

Server time is: 2026-07-25 16:20:05
Your offset time is: 2026-07-25 16:20:05