Answer the question
In order to leave comments, you need to log in
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
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.
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
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
#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 )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question