I
I
Ivan Antonov2019-02-20 11:00:19
linux
Ivan Antonov, 2019-02-20 11:00:19

How to implement 3D rendering with selected textures for a php site?

The task is to make a house model constructor for the site.
There will be a sidebar with different sets of textures for different parts of the house (walls, roof, windows, etc.) and a final JPG image that should change when you change the texture selection.
As I believe, you need to render on the server side. Of course, there were thoughts of doing it on the frontend (JS, Canvas, webgl), but there is a high probability of leakage of textures and models.
A request is sent to the server with all the necessary parameters, the server renders the image and gives the client only that image.
Now, in fact, the question is - using what technologies can this be implemented without problems?
You can not be limited to PHP, but execute in any other language, and "fasten" to php using the exec.
There were thoughts to use blender's python functions, but no idea how to do it. If there is a suggestion, I will be very grateful.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergei Nazarenko, 2016-09-04
@nazares

Install on SSD along with Windows

B
Boris Yakushev, 2016-09-04
@za4me

I dug up an old hdd, put ubuntu on it for testing. I wo n’t climb back to windows now :)
I think it would be better to put it on the second disk, so that if something happens, go painlessly to windows and not lose data.

T
tartarelin, 2016-09-05
@tartarelin

And then the question arises - why?
If you just look, then a live CD is enough, if you experiment, then virtualbox or VMWare Player, if you are going to switch to linux, then backup windows and install linux instead

T
Tremo, 2016-09-05
@tremo0880

1. Do dualboot on ssd. With the boot, you will choose which operating system to load.
2. Download the liveCd of any Linux distribution and install it on a fresh drive. You can boot from it
PS I myself am sitting on a dual block

D
Dnebl, 2019-02-20
@antonowano

There is such a scene in demo.blend

в сцене создал объекты и изменил их названия в дереве сцены
сохраняем сцену в файл
and such a script
in the script we find the object, create a material, texture, apply it to the object, and render the scene
#blender-demo.py
import bpy
import os

cubeMesh = bpy.data.objects['CUBE_1'] #находим нужный объект 

mat = bpy.data.materials['Material'] 
tex = bpy.data.textures.new('TextureName', 'IMAGE') 

image_path = '/home/username/texture.jpg'
image = bpy.data.images.load(image_path) 
tex.image = image

slot = mat.texture_slots.add()
slot.texture = tex
cubeMesh.data.materials.append(mat) 

bpy.data.scenes['Scene'].render.filepath = '/home/username/demo.png'
bpy.ops.render.render( write_still=True )

Next, run blender with the command
here is the demo.png output
5c6d23bfd5576844856177.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question