Empower growth and innovation with the latest 3D Modeling insights

Same 3D product page fills the frame on desktop but shrinks on mobile portrait—should camera distance be recalculated based on screen width?

Oct 31, 2026 Read: 62

Conclusion: For the same web 3D product page, if the product is pushed to the edge on desktop but shrinks into a small block in mobile portrait, the common cause is not that a single camera parameter is hard-coded, but that the camera was calculated only once using the desktop canvas aspect ratio. In a Three.js perspective camera, fov is the vertical viewing angle; when the canvas becomes narrower and taller, the vertical field of view stays the same while the horizontal field of view drops sharply. If only aspect is changed, horizontal content is cut first; if scaling is based only on width, the portrait subject becomes too small. Based on 2026 project delivery experience, a more reliable approach is to separate composition safe frame and camera adaptation into two layers: first define the subject proportion range, then let camera distance or FOV compensate with aspect ratio.

1. Why does it fit on desktop but either crop or shrink in portrait?

The fov of a perspective camera is the vertical angle of view, and image width is determined by aspect. Desktop browsers commonly use 16:9 or 21:9, with aspect around 1.6–2.3; mobile portrait is around 9:19.5, leaving aspect at only 0.45–0.56—a difference of three to five times. When the vertical field of view is unchanged, the horizontal range shrinks proportionally and both ends of the product are cut first; conversely, if horizontal field of view is fixed, portrait mode pushes the whole product farther away and it appears to shrink into a small block.

The second high-frequency cause is that the dimension chain is not connected. WebGL drawing buffer size and CSS size are two different sets of numbers; renderer.setSize uses CSS pixels, and devicePixelRatio affects clarity rather than composition. When the container has a hard-coded px height and the code fixes aspect at 16/9, the portrait canvas is squashed or letterboxed—it looks like the camera is not adapted, but the actual issue is that dimensions are not aligned.

  • fov is a vertical field of view; changing only aspect will not automatically recover horizontal content, so distance or FOV compensation is needed.
  • A fixed-width-and-height container plus CSS stretching is a high-frequency source of portrait distortion, especially in embedded iframes.
  • Listening only to window resize and not to container size changes causes misalignment when a sidebar opens or a modal appears.
  • Multiplying devicePixelRatio twice improves clarity, but composition errors remain.

2. Define the safe frame and subject proportion first, then write compensation

Order it by delivery: the safe frame answers what content must not be cropped, proportion answers whether the product looks the same size on every device, and compensation answers how the code calculates it automatically. If the order is reversed, it becomes a separate set of manually tuned parameters for every breakpoint, and maintenance cost multiplies later.

  1. Draw the safe frame: Mark an inner frame and an outer frame on the baseline canvas; place the product subject, LOGO, and selling-point copy inside the inner frame, which should occupy about 70%–80% of the canvas.
  2. Set subject proportion: The experience range for subject height or width in the frame is 55%–70%; portrait can be relaxed to 50%–80%, but key structures such as buttons and ports must not be cropped.
  3. Set the baseline camera position: First lock the camera position, target point, and focal length at a ratio close to 1:1 or 16:9 as the reference for all devices.
  4. Write compensation rules: Keep vertical fov unchanged and back-calculate camera distance by aspect for forward/backward compensation, commonly moving back 1.2–1.6 times; or fix horizontal field of view and back-calculate fov using hfov.
  5. List breakpoints: Use four tiers—375–430 CSS px mobile portrait, 768–1024 tablet, 1280–1920 desktop, and 21:9 ultrawide—and keep one screenshot for each.
  6. Extreme regression: Drag the canvas to 9:21 and 21:9 once each, confirming that the subject does not go outside the safe frame and the background does not reveal seams.

The focus differs: the safe frame should be defined before modeling and rendering; adding it later affects the camera, lighting, and backdrop. When zooming into details in portrait, the subject easily touches the edge; when compensating by moving back, unbuilt backfaces and ground are easily exposed, so a backdrop or ground transition must be added before delivery.

3. Cost and schedule comparison of several common approaches

There are several ways to do the same thing; the difference is not technical sophistication but whether the client can accept whitespace, how tight the schedule is, and whether changes will be needed later. The person-days and integration cycles below are experience ranges, not fixed quotes.

  • A: Proportional contain with fixed camera: The camera and model stay unchanged, and centered proportional scaling adds margins. Change effort is about 0.5–1 person-day, with about 0.5 day of integration testing; the cost is obvious whitespace above and below in portrait or on both sides in landscape, which is often rejected in review.
  • B: Fixed vertical fov with distance compensation: Changes are concentrated in the camera control layer, about 1–3 person-days, with multi-device regression testing of about 0.5–2 days; once parameters are configurable, multiple devices share one model. The cost is that after moving back, the background, ground, and shadow range must be rechecked.
  • C: Fixed horizontal field of view with back-calculated fov: Keeps the subject complete horizontally, suitable for elongated products; change effort is about 1–2 person-days. The cost is that the product looks smaller in portrait and has more whitespace above and below.
  • D: Orthographic camera: Keeps proportions constant and suits engineering displays where dimensions are read; change effort is about 2–4 person-days. It is not suitable for product photos that emphasize realistic perspective and depth of field.

Three comparisons are enough: multi-device consistency, composition appearance, and later maintenance. A configurable-parameter solution takes effect on multiple devices after one change; a solution hard-coded into each page requires changes in multiple places. According to common 2026 delivery rhythms, B is usually the more balanced option in terms of value, but it is not suitable for every project.

4. Applicable and non-applicable boundaries

Suitable cases: web 3D showcases for a single product or a small number of SKUs, Three.js scenes embedded in landing pages, mini-program 3D, portrait advertising screens, and exhibition touchscreens. In such scenarios the canvas size is determined by the user's device, and a single hard-coded set of parameters rarely covers all terminals.

Cases where it is unnecessary: scenarios such as broadcast control walls where resolution is uniformly controlled by the project owner, where acceptance at 16:9 is sufficient; measurement displays requiring strict dimensional comparison, where dynamically changing the camera breaks proportions and an orthographic camera with a scale bar should be used instead; and fixed-projection solutions such as VR panoramas, where composition is determined by projection and camera changes bring limited benefit. Boundary statement: When terminal resolution is uniformly controlled by the project owner, the benefit of dynamic adaptation is usually smaller than the integration cost it introduces.

5. On delivery: rework is often not in the camera itself

A common constraint is this: the client has confirmed only one 1920×1080 composition screenshot, the front end has already hard-coded renderer.setSize at 16:9 into the page, and launch is only two or three days away. If you copy the camera position directly from the screenshot, a portrait test will reveal a cropped subject, exposed ground, and a backdrop showing at the edges. A common practice is to first extract the camera target point, distance, and fov into configuration items, add a safe-frame guide line, and produce three screenshots each in landscape and portrait for the client to confirm at once, keeping disputes before launch.

The cost is real: saving adaptation early often means later readjusting the camera position, adding a backdrop and ground transition, commonly costing an extra 1–3 person-days; if the product photos were selected for a landscape composition, portrait may also require reshoots or re-rendering, pushing the schedule further back. Moving adaptation earlier has an experience range of 0.5–1.5 extra person-days upfront, but it can reduce post-launch rework and repeated integration testing.

6. Acceptance criteria can be written into the checklist

Acceptance should not rely on “it looks fine to me” but should be tied to checkable actions. It is recommended to write the following items into the delivery checklist and test both landscape and portrait before delivery.

  • At 375–430 CSS px wide mobile portrait, the subject is complete and key structures are not cropped.
  • At the two extreme ratios of 21:9 and 9:21, no background seams or stretching distortion appear.
  • When rotating the screen or dragging the window, the image does not flicker or go black, and the resize event is debounced.
  • On devices with devicePixelRatio 2–3, textures are not blurry and overlaid text is readable.
  • On mid-range devices on a 4G network, the experience range for time to interactive on first screen is 2–5 seconds.

Common pitfalls are concentrated in: offsetWidth returning 0 during initialization, rebuilding the renderer on resize and losing the context, drawing UI text into the canvas so it becomes blurry after scaling, and delivering after testing on only one phone. If the five items above are met and these four pitfalls are blocked, it can basically be considered qualified.


Frequently asked questions

How many extra days does multi-device adaptation usually take?

Experience range is 2–5 person-days, depending on the number of breakpoints and whether the background needs to be redone; if only camera compensation is done and the model is unchanged, it usually falls at the lower end.

Does this adaptation belong to modeling or front-end?

The baseline camera position and safe frame are defined by the modeling and rendering side; the compensation logic that changes with the canvas is implemented by the front end. The handoff artifact is a configurable camera parameter table.

Can one set of parameters support both large screens and portrait phones?

Yes, provided that distance or field of view can compensate with aspect and that the model backfaces and background are completed; fixed parameters forced across devices commonly reveal seams on one end.

What should be given to the front end at delivery?

Commonly a GLB model, a camera parameter JSON containing target point, distance, fov, and breakpoints, safe-frame documentation, and a set of acceptance screenshots, in the format agreed in the integration document.

Interested in this topic?
10-year tech team — reference proposal within 24 hours
Obtain Proposal
Are you ready?
Then reach out to us!
+86-13370032918
Discover more services, feel free to contact us anytime.
Please fill in your requirements
What services would you like us to provide for you?
Your Budget
ct.
Our WeChat
Professional technical solutions
Phone
+86-13370032918 (Manager Jin)
The phone is busy or unavailable; feel free to add me on WeChat.
E-mail
349077570@qq.com
Submitted successfully
Thank you for your trust. We will contact you soon!
Recommended projects for you