Dev Blog

Hi, this is the Stranded III development blog (see also Forum Thread, Comment Thread).

Overview (115 Entries)

Entry 67 - Offsets, backpack, 100 - June 18, 2017

Inventory Item Offset
Remember the mushroom problem from last blog entry? The offset?
I solved it and it was easier than expected. The solution was to get the Renderer component and to use the center of its bounds. This offset needs to be subtracted from the original rendering position, taking the object rotation into account. Here's a code sample:
Quaternion renderRot = GetFancyRotationStuff()
Vector3 renderPos = GetFancyPositionStuff()

Renderer renderer = GameObject.GetComponent<Renderer>();
renderPos += renderRot *;

// do render stuff using renderPos and renderRot

Here you can see the result of that change. No weird offsets anymore!

You can also see that I tried less annoying rotation and added a "scale on hover" effect. This is still work in progress and needs some fine tuning.
Colors are pretty ugly due to bad gif compression.

It really annoyed me to see the white backpack in my inventory so I textured it!

> click to enlarge

I should have double checked the geometry before UV mapping. Now there's crazy stretching going on in some places but... hell.. whatever!

I did it! I made a model with exactly 100 tris! I didn't even plan it. Coincidence? Fortune? One thing is for sure: It's a tremendous achievement. People will tell the amazing story about the model with exactly one hundred triangles for centuries to come. And what majestic thing did I create while randomly hitting that wonderful triangle count? A snail. A slimy little snail. Not even a very good one (I screwed something up with the shell and I don't want to talk about it). Great!

> click to enlarge


blog comments powered by Disqus