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:
1
2
3
4
5
6
7
Quaternion renderRot = GetFancyRotationStuff()
Vector3 renderPos = GetFancyPositionStuff()

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

// do render stuff using renderPos and renderRot


Here you can see the result of that change. No weird offsets anymore!
IMG:https://stuff.unrealsoftware.de/pics/s3dev/ui/inventory3d_v2.gif

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.

Backpack
It really annoyed me to see the white backpack in my inventory so I textured it!
IMG:https://stuff.unrealsoftware.de/pics/s3dev/models/backpack_pre.jpg

> 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!

100
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!
IMG:https://stuff.unrealsoftware.de/pics/s3dev/models/snail_pre.jpg

> click to enlarge

Disqus

blog comments powered by Disqus